mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 10:10:48 +01:00
- Added a new gate called `viewPulse` in the `AuthServiceProvider` class. - The gate allows only admin users to view the Pulse feature.
21 lines
455 B
PHP
21 lines
455 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
|
class AuthServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any authentication / authorization services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
Gate::define('viewPulse', function (User $user) {
|
|
return $user->admin;
|
|
});
|
|
}
|
|
}
|