diff options
author | Camil Staps | 2016-09-25 23:56:46 +0200 |
---|---|---|
committer | Camil Staps | 2016-09-26 01:02:05 +0200 |
commit | 33ad0c14d168d36a4e7ad42dc6aa6a37a7335849 (patch) | |
tree | 0543b7d92f7f0b7706f4313ba10b18483f747798 /app/Providers/AuthServiceProvider.php | |
parent | Added unique visitors to statistics (diff) |
Change from lumen 5.2 to laravel 5.3 (Resolves #1)
Diffstat (limited to 'app/Providers/AuthServiceProvider.php')
-rw-r--r-- | app/Providers/AuthServiceProvider.php | 49 |
1 files changed, 20 insertions, 29 deletions
diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 7cf4b27..9784b1a 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -2,38 +2,29 @@ namespace App\Providers; -use App\User; -use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Gate; -use Illuminate\Support\ServiceProvider; +use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; class AuthServiceProvider extends ServiceProvider { - /** - * Register any application services. - * - * @return void - */ - public function register() - { - // - } + /** + * The policy mappings for the application. + * + * @var array + */ + protected $policies = [ + 'App\Model' => 'App\Policies\ModelPolicy', + ]; - /** - * Boot the authentication services for the application. - * - * @return void - */ - public function boot() - { - // Here you may define how you wish users to be authenticated for your Lumen - // application. The callback which receives the incoming request instance - // should return either a User instance or null. You're free to obtain - // the User instance via an API token or any other method necessary. - Auth::viaRequest('api', function ($request) { - if ($request->input('api_token')) { - return User::where('api_token', $request->input('api_token'))->first(); - } - }); - } + /** + * Register any authentication / authorization services. + * + * @return void + */ + public function boot() + { + $this->registerPolicies(); + + // + } } |