idea-php-laravel-plugin
idea-php-laravel-plugin copied to clipboard
Route names detection for "route()" depends on "->name()" position in the route definition
PhpStorm 2017.1.4 on Windows 10 x64 running bundled x64 JDK; Laravel Plugin 0.14.2
Completion helper for route names seems to depend on the calling order.
This one works and browse.deal
is offered inside route()
call:
Route::get('deals/{id}-{slug}', 'DealController@showDeal')->name('browse.deal')->where(['id' => '\d+', 'slug' => '[a-z0-9\-]+']);
But if we swap ->name()
and ->where()
around in the chain ... it will stop recognizing the name:
Route::get('deals/{id}-{slug}', 'DealController@showDeal')->where(['id' => '\d+', 'slug' => '[a-z0-9\-]+'])->name('browse.deal');