Return to homepage
01/01. Magically invoking Laravel controller methods

Comments

RICHARD

Some similary have laracasts in this video https://laracasts.com/series/php-bits/episodes/6 to go deeper.

  • 0
Khary

Took this one step further and removed ->namespace($this->namespace) from RouteServiceProvider then did this.

1use App\Http\Controllers\MeController;
2 
3Route::get('/me', MeController::class);

Now I can click through to the controller in my IDE.

  • 5
Wouter

You don't need to remove that piece of code to do that tho.

Also phpstorm allows you to click through to the class even if you type "MeController".

  • 0
Omar

waaw... so cool

  • 1
Célien

To anyone interested in this subject, Adam Wathan had a talk about breaking up controllers for clarity at Laracon US 2017, video available at https://streamacon.com/video/laracon-us-2017/day-1-adam-wathan.

  • 6