for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use Laravel\Telescope\IncomingEntry;
use Laravel\Telescope\Telescope;
use Laravel\Telescope\TelescopeApplicationServiceProvider;
class TelescopeServiceProvider extends TelescopeApplicationServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
// Telescope::night();
$this->hideSensitiveRequestDetails();
Telescope::filter(function (IncomingEntry $entry) {
if ($this->app->isLocal()) {
return true;
}
return $entry->isReportableException() ||
$entry->isFailedJob() ||
$entry->isScheduledTask() ||
$entry->hasMonitoredTag();
});
* Prevent sensitive request details from being logged by Telescope.
protected function hideSensitiveRequestDetails()
return;
Telescope::hideRequestParameters(['_token']);
Telescope::hideRequestHeaders([
'cookie',
'x-csrf-token',
'x-xsrf-token',
]);
* Register the Telescope gate.
* This gate determines who can access Telescope in non-local environments.
protected function gate()
Gate::define('viewTelescope', fn ($user = null) => backpack_user() && backpack_user()->email === config('app.admin_email'));
$user
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
Gate::define('viewTelescope', fn (/** @scrutinizer ignore-unused */ $user = null) => backpack_user() && backpack_user()->email === config('app.admin_email'));
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
email
Illuminate\Contracts\Auth\Authenticatable
instanceof
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.