jonnybarnes.uk/app/Providers/HorizonServiceProvider.php

33 lines
663 B
PHP
Raw Normal View History

<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use Laravel\Horizon\HorizonApplicationServiceProvider;
/**
* @psalm-suppress UnusedClass
*/
class HorizonServiceProvider extends HorizonApplicationServiceProvider
{
/**
* Bootstrap any application services.
*/
2023-02-18 09:34:57 +00:00
public function boot(): void
{
parent::boot();
}
/**
* Register the Horizon gate.
*
* This gate determines who can access Horizon in non-local environments.
*/
2023-02-18 09:34:57 +00:00
protected function gate(): void
{
Gate::define('viewHorizon', function ($user) {
2022-05-14 17:44:14 +01:00
return $user->name === 'jonny';
});
}
}