2019-03-01 04:51:58 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
|
|
use Laravel\Horizon\Horizon;
|
|
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
|
use Laravel\Horizon\HorizonApplicationServiceProvider;
|
|
|
|
|
|
|
|
class HorizonServiceProvider extends HorizonApplicationServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bootstrap any application services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
|
|
|
parent::boot();
|
|
|
|
|
|
|
|
// Horizon::routeSmsNotificationsTo('15556667777');
|
|
|
|
// Horizon::routeMailNotificationsTo('example@example.com');
|
|
|
|
// Horizon::routeSlackNotificationsTo('slack-webhook-url', '#channel');
|
2019-05-05 22:42:07 +00:00
|
|
|
|
|
|
|
if(config('horizon.darkmode') == true) {
|
|
|
|
Horizon::night();
|
|
|
|
}
|
2019-03-01 04:51:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register the Horizon gate.
|
|
|
|
*
|
|
|
|
* This gate determines who can access Horizon in non-local environments.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
protected function gate()
|
|
|
|
{
|
|
|
|
Gate::define('viewHorizon', function ($user) {
|
|
|
|
return $user->is_admin == true;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|