Laravel 5.2 : Adding Auth module in pingpong -


how add 'default laravel auth module' pingpong module folder?

php artisan make:auth  

above commands create auth controller/module in default http folder. i'm using pingpong component create modules in project. so, want move auth controller pingpong module folder. there command pingpong install auth directly in pingpong module folder

you can make controllers , blade-templates manually. use custom auth.php config

    'defaults' => [     'guard' => 'admin',     'passwords' => 'admins', ],     'guards' => [     'admin' => [         'driver' => 'session',         'provider' => 'admins',     ],      'api' => [         'driver' => 'token',         'provider' => 'users',     ], ],     'providers' => [     'admins' => [         'driver' => 'eloquent',         'model' => modules\admin\models\admin::class,     ],  ], 'passwords' => [     'admins' => [         'provider' => 'admins',         'email' => 'admin::auth.emails.password',         'table' => 'password_resets',         'expire' => 60,     ], ], 

but in case need create custom middleware with

    public function handle($request, closure $next) {     foreach(['auth','database','database.connections','admin'] $key) {         $config = config::get($key, []);         $path = __dir__.'/../../config/' . preg_replace('/\w/i','_',$key) . '.php';         config::set($key, array_merge($config, require $path));     }      return $next($request); } 

this code merges global config custom config cripts (any options, database connections , etc.)

create templates , login forms. can use 'admin::auth.emails.password' including templates othe rmodules. moreover, can use

protected $guard = 'admin'; protected $loginview = 'admin::auth.login'; protected $registerview = 'admin::auth.register'; 

in modules\admin\http\controllers\auth\authcontroller ,

protected $redirectto = '/admin'; protected $linkrequestview = 'admin::auth.passwords.email'; protected $resetview = 'admin::auth.passwords.reset'; 

in modules\admin\http\controllers\auth\passwordcontroller .


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -