Support the ongoing development of Laravel.io →
posted 11 years ago
Requests

I like to keep my controllers based on the sections they represent so I put them in folders. In this situation I have a folder caller tracker inside my controllers folder. I am trying to add it to the Route but its telling me that it can't find it.

So something like app->controller->tracker->TrackerController.php

Route::get('/tracker','tracker/TrackerController@index');

Thanks for any information you can provide!

Last updated 2 years ago.
0

I also keep my controllers in folders like admin, frontend etc... and I don't use folder name at all. It resolves by itself. Please try like it's not inside a sub folder.

// app/controllers/tracker/TrackerController.php
// Do not forget "composer dump-autoload" after controller creation
Route::get('tracker','TrackerController@index');
Last updated 2 years ago.
0

I wonder if you need to delete the compile.php so that it gets recreated to find your new files.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

wkolcz wkolcz Joined 17 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.