anbu icon indicating copy to clipboard operation
anbu copied to clipboard

Anbu::disable() does not work

Open gabarba opened this issue 10 years ago • 1 comments

I had a need to disable the Anbu for a particular request while testing and I was presented with the following error

Undefined index: disable …/­vendor/­daylerees/­anbu/­src/­Profiler.php:338

I figured it was an issue in the Facade class itself so I was able to fix it with the following.

<?php

namespace Anbu\Facades;

use App;

class Anbu
{
    /**
     * Proxy static method calls to module instances.
     *
     * @param  string $method
     * @param  mixed  $args
     * @return mixed
     */
    public static function __callStatic($method, $args)
    {
        // Resolve profiler from container.
        $profiler = App::make('Anbu\\Profiler');

       if($method == 'disable')
        {
           return $profiler->disable();
        }

        if($method == 'hide')
        {
           return $profiler->hide();
        }


        // Return the module instance by method name.
        return $profiler->getModule($method);
    }
}

Im sure that you may have a better solution to this issue than this one but I just wanted to give you a heads up.

gabarba avatar Oct 01 '14 19:10 gabarba

I have the same issue.

    //Anbu::hide(); // does not work

    $anbu = App::make('Anbu\\Profiler');
    $anbu->hide();

toonevdb avatar Dec 18 '14 02:12 toonevdb