mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-04 04:54:36 -04:00
52 lines
1.3 KiB
PHP
52 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Laravel\Telescope\EntryType;
|
|
use Laravel\Telescope\Telescope;
|
|
use Illuminate\Support\Facades\Gate;
|
|
use Laravel\Telescope\IncomingEntry;
|
|
use Laravel\Telescope\Contracts\EntriesRepository;
|
|
use Laravel\Telescope\TelescopeApplicationServiceProvider;
|
|
|
|
class TelescopeServiceProvider extends TelescopeApplicationServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
// Telescope::night();
|
|
|
|
Telescope::filter(function (IncomingEntry $entry) {
|
|
if ($this->app->environment() == 'local') {
|
|
return true;
|
|
}
|
|
|
|
return $entry->isReportableException() ||
|
|
$entry->isFailedJob() ||
|
|
$entry->isScheduledTask() ||
|
|
$entry->hasMonitoredTag();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Register the Telescope gate.
|
|
*
|
|
* This gate determines who can access Telescope in non-local environments.
|
|
*
|
|
* @return void
|
|
*/
|
|
protected function gate()
|
|
{
|
|
Gate::define('viewTelescope', function ($user) {
|
|
return in_array($user->email, [
|
|
config('ninja.contact.email'),
|
|
'turbo124@gmail.com'
|
|
]);
|
|
});
|
|
}
|
|
}
|