mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
3b0cda1502
* Fixes for tests * fixes for permissions * Set default company on account creation * Ensure default company ID is registered in session variables * Implement a generic resolver to harvest an entity from encoded value * Laravel Telescope
50 lines
1.1 KiB
PHP
50 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Laravel\Telescope\Telescope;
|
|
use Illuminate\Support\Facades\Gate;
|
|
use Laravel\Telescope\IncomingEntry;
|
|
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->isLocal()) {
|
|
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, [
|
|
//
|
|
]);
|
|
});
|
|
}
|
|
}
|