spatie / laravel-ray

Debug with Ray to fix problems faster in Laravel apps

Home Page:https://myray.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ray()->queries() BadMethodCallException

wdavis opened this issue · comments

Describe the bug
ray()->queries() and ray()->showQueries() both throw BadMethodCallException exceptions.

Versions
Ray 1.04
Laravel Ray 1.20

PHP version: 7.4.11
Laravel version: 8.21.0

To Reproduce
Steps to reproduce the behavior:
Add ray()->queries() or ray()->showQueries()

Expected behavior
Expect queries to be output to the Ray app.

Screenshots

Desktop (please complete the following information):

  • OS: macOS
  • Version 11.1

Additional context

Stack trace:

BadMethodCallException Method queries does not exist. 
    vendor/spatie/macroable/src/Macroable.php:66 Spatie\Ray\Ray::__call
    routes/web.php:7 require
    vendor/laravel/framework/src/Illuminate/Routing/RouteFileRegistrar.php:35 Illuminate\Routing\RouteFileRegistrar::register
    vendor/laravel/framework/src/Illuminate/Routing/Router.php:424 Illuminate\Routing\Router::loadRoutes
    vendor/laravel/framework/src/Illuminate/Routing/Router.php:381 Illuminate\Routing\Router::group
    vendor/laravel/framework/src/Illuminate/Routing/RouteRegistrar.php:135 Illuminate\Routing\RouteRegistrar::group
    app/Providers/RouteServiceProvider.php:48 App\Providers\RouteServiceProvider::App\Providers\{closure}
    vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}
    vendor/laravel/framework/src/Illuminate/Container/Util.php:40 Illuminate\Container\Util::unwrapIfClosure
    vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:81 Illuminate\Container\BoundMethod::callBoundMethod
    vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37 Illuminate\Container\BoundMethod::call
    vendor/laravel/framework/src/Illuminate/Container/Container.php:610 Illuminate\Container\Container::call
    vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/RouteServiceProvider.php:120 Illuminate\Foundation\Support\Providers\RouteServiceProvider::loadRoutes
    vendor/laravel/framework/src/Illuminate/Foundation/Support/Providers/RouteServiceProvider.php:45 Illuminate\Foundation\Support\Providers\RouteServiceProvider::Illuminate\Foundation\Support\Providers\{closure}
    vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}
    vendor/laravel/framework/src/Illuminate/Container/Util.php:40 Illuminate\Container\Util::unwrapIfClosure
    vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:81 Illuminate\Container\BoundMethod::callBoundMethod
    vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:37 Illuminate\Container\BoundMethod::call
    vendor/laravel/framework/src/Illuminate/Container/Container.php:610 Illuminate\Container\Container::call
    vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:113 Illuminate\Support\ServiceProvider::callBootedCallbacks
    vendor/laravel/framework/src/Illuminate/Foundation/Application.php:872 Illuminate\Foundation\Application::bootProvider
    vendor/laravel/framework/src/Illuminate/Foundation/Application.php:850 Illuminate\Foundation\Application::Illuminate\Foundation\{closure}
    [internal] array_walk
    vendor/laravel/framework/src/Illuminate/Foundation/Application.php:851 Illuminate\Foundation\Application::boot
    vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php:17 Illuminate\Foundation\Bootstrap\BootProviders::bootstrap
    vendor/laravel/framework/src/Illuminate/Foundation/Application.php:230 Illuminate\Foundation\Application::bootstrapWith
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:152 Illuminate\Foundation\Http\Kernel::bootstrap
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:136 Illuminate\Foundation\Http\Kernel::sendRequestThroughRouter
    vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:110 Illuminate\Foundation\Http\Kernel::handle
    public/index.php:52 require
    /Users/wdavis/.composer/vendor/laravel/valet/server.php:214 [main]

PHPStorm (2020.3.1) does not recognize the methods either.

Screen Shot 2021-01-08 at 7 22 56 AM

Screen Shot 2021-01-08 at 8 02 32 AM

Invalidating the PHPStorm caches had no effect on discovering the methods.

Are you using the laravel-ray package ? because it's only available in this package and not just ray package

Closing this, because @Ashraam is right.

You should run composer require spatie/laravel-ray