<?php

namespace AuthStack\Driver\AUDGeneric;

use Illuminate\Support\ServiceProvider;

class AUDGenericDriverServiceProvider extends ServiceProvider
{
    public function boot()
    {
        $router = $this->app['router'];
        $router->pushMiddlewareToGroup('aud', \AuthStack\Driver\AUDGeneric\App\Middleware\AUD::class);

        $this->loadRoutesFrom(__DIR__ . '/routes.php');

        $this->loadMigrationsFrom(__DIR__ . '/database/migrations');

        $this->loadViewsFrom(__DIR__ . '/views/aud', 'aud');

        $this->publishes([
            __DIR__ . '/views/aud/password' => resource_path('views/vendor/aud/password'),
        ], 'aud_views');

        $this->publishes([
            __DIR__ . '/database/seeds/' => database_path('seeds/')
        ], 'aud_seeder');
    }
}
