Git Product home page Git Product logo

laravel-api-debugger's People

Contributors

amcsi avatar denisjunio avatar mannysoft avatar masnathan avatar mlanin avatar spacedog4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-api-debugger's Issues

Model name of database query

Thanks for making this debugger tool.

I want to display the 'model' (query running from particular model) parameter name like this:

"debug": {
      "database": {
          "total": 5,
          "items": [
              {  
                  "model": "App\User",
                  "connection": "mysql",
                  "query": "select * from `ta_users`;",
                  "time": 106.27
              },
          ]
      }
 }

Please help me with this additional parameter.
Thanks

Object of class DateTime could not be converted to string

FatalErrorException in QueriesCollection.php line 73:
Object of class DateTime could not be converted to string

this happens when using Laravel's Passport to generate tokens. The tokens are inserted into db as DateTime and it seems there are problems when doing

$query = vsprintf(str_replace(['%', '?'], ['%%', "'%s'"], $query), $attributes) . ';';

capture

you can see in the attached screenshot that $atributes[5] and $atributes[6] are of type DateTime..

Show total time queries.

Hi,
It's or will be possible see total time of all queries?
Right now is possible see time for each query, but not for all queries.

Thank you very much.

Feature request, Sort by time

Would be very cool and useful if this at least had an option to sort by the execution time, I use your package to frequently debug long queries

Argument 1 passed to ServiceProvider::registerCollections() must be of the type array, null given

Hi, im on Laravel Framework 6.17.1 run into this :

Symfony\Component\Debug\Exception\FatalThrowableError : Argument 1 passed to Lanin\Laravel\ApiDebugger\ServiceProvider::registerCollections() must be of the type array, null given, called in E:\laragon-x86\www\w4c\vendor\lanin\laravel-api-debugger\src\ServiceProvider.php on line 26

any clue why this happen?
one can temporary fix by copy paste array from config to this ServiceProvider.php :

public function boot()
    {
        $configPath = __DIR__ . '/../config/api-debugger.php';
        $this->publishes([$configPath => config_path('api-debugger.php')]);
        $this->mergeConfigFrom($configPath, 'api-debugger');

        // Register collections only for debug environment.
        $config = $this->app['config'];
        if ($config['app.debug']) {
            $this->registerCollections([
                // Database queries.
                \Lanin\Laravel\ApiDebugger\Collections\QueriesCollection::class,

                // Show cache events.
                \Lanin\Laravel\ApiDebugger\Collections\CacheCollection::class,

                // Profile custom events.
                \Lanin\Laravel\ApiDebugger\Collections\ProfilingCollection::class,
            ]);
        }
    }

Disabling not working

I have in my .env-File:

APP_DEBUG=false
API_DEBUGGER_ENABLED=false

But debug is not disabled.

Does not display query if exception is thrown

First of all, great package, thanks !

I noticed a problem though.
if an error is caught like so:
catch ( QueryException $e) {
$mssg = "An account with these details already exists";
return response()->json(["error_list" => compact('mssg')]);
}

the sql key inside debug is blank.
any way to fix this ?

Enable / Disable Switch

Is there any option to disable debugging dynamically, for example to enable for certain requests and disable for others? Something like:

Debugger::disable();
Debugger::enable();

Thank you

Crashes if the response is not an object

First, thanks for the work on this package.

Trying to return a simple response with "Unauthorized"

return response()->json("Unauthorized", 401)

The variable $data on src/Debugger.php line 117 will then be "Unauthorized".

This will cause a crash on line 123 on the same function when attempting to add the debugging details to the $data variable which is a string, not an object.

$data->{$this->responseKey} = $this->storage->getData();

This can be easily fixed if a check is added before the information is added to $data variable.

L.E.: I know there is an workaround to change response to:

return response()->json(["message" => "Unauthorized"], 401)

but would be nice if you could still return something without wrapping it and i would like to not return debug info when an user is not authenticated.

Maybe another idea would be to be able to disable logging on the fly, something like

Debugger::disable();

Version: 3.5.0.
Laravel version: 6.17.1

Please let me know if you need additional information.

Documentation is blurry

I'm trying to implement your package but i have no result, i tried the facade way but no success

It will crash if the response data is empty

it will crash if the response data is empty :-

the fix go to line 110 and replace:

$data = $response->getData(true);
by
$data = $response->getData(true) ?: [];

that should do it..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.