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

Amit Kumar
Jan 20, 2021

--

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.

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. 👍👍

--

--

Amit Kumar
Amit Kumar

Written by Amit Kumar

Hi I am Amit Experienced Web Developer with a demonstrated history of working in the information technology and services industry.

No responses yet