Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDario Preglej
9,771 PointsTarget class does not exist
I got error: target class does not exist, and i spent few hours trying to look for every character in my code as i tough i wrote something wrong. Then i google it and i found out that in Laravel 8 you need to write route differently, like this:
Route::get('/', 'App\Http\Controllers\AppController@index');
This solve my problem.
1 Answer
Jennifer Nordell
Treehouse TeacherHi there, Dario Preglej! Yes, that's correct. Laravel 8 changes the namespacing somewhat. I updated the Teacher's Notes to include instructions on how to install Laravel 6 when taking this course to avoid this confusion in the future. Let's hope that between the Teacher's Notes and your answer that the confusion is significantly lessened.
To be clear, Laravel 6 is the latest LTS (long-term support) version of Laravel and should be used both for this course and the Laravel API course
Thanks for the information regarding Laravel 8 changes!
PABLO MORICZ DE TECSO
601 PointsPABLO MORICZ DE TECSO
601 PointsHello, also for this problem and in case you do want to keep using Laravel 8 for whatever reason, this guy explains how to reverse the changes done in Laravel 8, for it to behave like Laravel 6 and 7 in that regard.
https://www.youtube.com/watch?v=MfE1tnMG6fE
Also there is this stack Overflow article talking about this: https://stackoverflow.com/questions/63807930/target-class-controller-does-not-exist-laravel-8