mlanin / laravel-api-debugger

Easy debug for your JSON API.
http://blog.lanin.me/easy-debug-for-your-json-api/
MIT License
233 stars 54 forks source link

Object of class DateTime could not be converted to string #4

Closed jonagoldman closed 7 years ago

jonagoldman commented 7 years ago
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..

mlanin commented 7 years ago

Thanks for report, I'll try to fix it somehow...

mlanin commented 7 years ago

Fixed in 0.3.1. Update please.

jonagoldman commented 7 years ago

working for me now. thanks!

hendisantika commented 4 years ago

I have same issue like @jonagoldman . I am using php 7.4 & Laravel 7.9.1. Any suggestion??

<!DOCTYPE html>
<!--

Symfony\Component\Debug\Exception\FatalThrowableError: Object of class DateTime could not be converted to string in file /Users/hendisantika/Documents/freelance/dvoretsky/scrubber-backend/vendor/lanin/laravel-api-debugger/src/Collections/QueriesCollection.php on line 120
Stack trace:
  1. Symfony\Component\Debug\Exception\FatalThrowableError-&gt;() /Users/hendisantika/Documents/App/Project/vendor/lanin/laravel-api-debugger/src/Collections/QueriesCollection.php:120
  2. {main}() /Users/hendisantika/Documents/App/Project/scrubber-backend/server.php:0
hendisantika commented 4 years ago

BTW, can you show me how to set debugger in PhpStorm @jonagoldman ???

jonagoldman commented 4 years ago

@hendisantika this issue is 3 years old, not longer using PhpStorm. But there are a lot of articles around on how to configure the debugger.