AuthServiceProvider.php 800 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Providers;
  3. // use Illuminate\Support\Facades\Gate;
  4. use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
  5. class AuthServiceProvider extends ServiceProvider
  6. {
  7. /**
  8. * The model to policy mappings for the application.
  9. *
  10. * @var array<class-string, class-string>
  11. */
  12. protected $policies = [
  13. // 'App\Models\Model' => 'App\Policies\ModelPolicy',
  14. 'App\Models\Board' => 'App\Policies\BoardPolicy',
  15. 'App\Models\Post' => 'App\Policies\PostPolicy',
  16. 'App\Models\Comment' => 'App\Policies\CommentPolicy'
  17. ];
  18. /**
  19. * Register any authentication / authorization services.
  20. *
  21. * @return void
  22. */
  23. public function boot()
  24. {
  25. $this->registerPolicies();
  26. //
  27. }
  28. }