Files

28 lines
578 B
PHP
Raw Permalink Normal View History

2026-09-16 11:43:27 +02:00
<?php
namespace App\Providers;
use App\Models\User;
use Illuminate\Support\Facades\Gate;
2026-09-16 11:43:27 +02:00
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
// TP8 bonus : l'administration est une capacité globale, donc un Gate est adapté.
Gate::define('viewAdmin', fn (User $user): bool => $user->is_admin);
2026-09-16 11:43:27 +02:00
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
//
}
}