Search code examples
laravellaravel-7laravel-api

Laravel 7 Api incomplete?


I started with Laravel 7 a few weeks ago. It happened to me multiple times that after reading about a topic on the Laravel website, I wanted to check the details of a function, for example:

Illuminate\Support\Facades\Route::group()

So I went to the Laravel API, and could find the Route facade, but not the group function.

What am I doing wrong? Where do you check for example the exact signature of a function?

Thanks!


Solution

  • The method group in Route::group() is inherited from another class, RegistrarGroup.

    See the docblock method in the source file, vendor/laravel/framework/src/Illuminate/Support/Facades/Route.php:

    @method static \Illuminate\Routing\Router|\Illuminate\Routing\RouteRegistrar group(\Closure|string|array $attributes, \Closure|string $routes)

    so, this is what you look for in the API documentation:

    https://laravel.com/api/7.x/Illuminate/Contracts/Routing/Registrar.html#method_group