4 changed files with 150 additions and 0 deletions
-
50src/Generators/ModelPolicyGenerator.php
-
29src/stubs/AuthServiceProvider.stub
-
70tests/Generators/ModelPolicyGeneratorTest.php
-
1tests/TestCase.php
@ -0,0 +1,29 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace App\Providers; |
||||
|
|
||||
|
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; |
||||
|
|
||||
|
class AuthServiceProvider extends ServiceProvider |
||||
|
{ |
||||
|
/** |
||||
|
* The policy mappings for the application. |
||||
|
* |
||||
|
* @var array |
||||
|
*/ |
||||
|
protected $policies = [ |
||||
|
'App\Model' => 'App\Policies\ModelPolicy', |
||||
|
]; |
||||
|
|
||||
|
/** |
||||
|
* Register any authentication / authorization services. |
||||
|
* |
||||
|
* @return void |
||||
|
*/ |
||||
|
public function boot() |
||||
|
{ |
||||
|
$this->registerPolicies(); |
||||
|
|
||||
|
// |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue