Skip to content

Commit 7d4b5d7

Browse files
committed
Default auth service provider.
1 parent 420e813 commit 7d4b5d7

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

app/Providers/AuthServiceProvider.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
namespace App\Providers;
4+
5+
use Illuminate\Contracts\Auth\Access\Gate as GateContract;
6+
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
7+
8+
class AuthServiceProvider extends ServiceProvider
9+
{
10+
/**
11+
* The policy mappings for the application.
12+
*
13+
* @var array
14+
*/
15+
protected $policies = [
16+
'App\Model' => 'App\Policies\ModelPolicy',
17+
];
18+
19+
/**
20+
* Register any application authentication / authorization services.
21+
*
22+
* @param \Illuminate\Contracts\Auth\Access\Gate $gate
23+
* @return void
24+
*/
25+
public function boot(GateContract $gate)
26+
{
27+
parent::registerPolicies($gate);
28+
29+
//
30+
}
31+
}

config/app.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@
141141
* Application Service Providers...
142142
*/
143143
App\Providers\AppServiceProvider::class,
144+
App\Providers\AuthServiceProvider::class,
144145
App\Providers\EventServiceProvider::class,
145146
App\Providers\RouteServiceProvider::class,
146147

0 commit comments

Comments
 (0)