laravel-debugbar icon indicating copy to clipboard operation
laravel-debugbar copied to clipboard

Add an enabler resolver config

Open systemsolutionweb opened this issue 6 months ago • 0 comments

What if a resolver is created, which can be declared within the configuration file, where extra validation can be added by returning a boolean,

for example: within the resolver validate if a user is an administrator and based on that enable the debugbar, it would not appear to any other user

Is there already such an option? Would it be a good idea to implement it to add more control?

class DebugbarEnableResolver implements Resolver
{
    public static function resolve(): bool
    {
        if (Auth::check() && Auth::user()->is_admin) {
            return true
        }
        
        // here maybe other conditions

        return false;
    }
}

systemsolutionweb avatar Apr 30 '25 17:04 systemsolutionweb