Class ‘App\Http\Controllers\Student’ not found

In this tutorial I’m going to describe how to solve “Class ‘App\Http\Controllers\Student’ not found” if you got this types of error please follow some easy steps

1step this types of error is showing when you’re not using class name whatever you have define below code as like :-

public function index()
{
$students = Student::all();

return view(‘students.dashboard’,compact(‘student’));
}

2nd you have to add your model name above of the StudenController class name

3rd step got your Controller :- StudentController.php

And add model name in the Student Controller class here as like this

use App\Student;

Then refresh your browser and you got solve your errors.

http://127.0.0.1:8000/

Thanks hopefully it will helpful for you. 👍👍

Tagged : / / / /
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x