forked from eatvio/eatvio-infra
40 lines
956 B
PHP
40 lines
956 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Models\BlogPost;
|
|
use App\Models\Diet;
|
|
use App\Models\Plan;
|
|
use App\Models\Recipe;
|
|
use App\Policies\BlogPostPolicy;
|
|
use App\Policies\DietPolicy;
|
|
use App\Policies\PlanPolicy;
|
|
use App\Policies\RecipePolicy;
|
|
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
|
|
|
class AuthServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* The policy mappings for the application.
|
|
*
|
|
* @var array<class-string, class-string>
|
|
*/
|
|
protected $policies = [
|
|
Plan::class => PlanPolicy::class,
|
|
Recipe::class => RecipePolicy::class,
|
|
BlogPost::class => BlogPostPolicy::class,
|
|
Diet::class => DietPolicy::class,
|
|
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
|
|
];
|
|
|
|
/**
|
|
* Register any authentication / authorization services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
$this->registerPolicies();
|
|
}
|
|
}
|