0

I can't understand where I made a mistake. The following is the error.

Symfony\Component\Debug\Exception\FatalThrowableError Class 'app\models\category' not found

class homepage extends Controller
{
    public function index()
    {
        print_r(category::all());
        die();

        return view('frontend.homepage', $categories);
    }
}

Error in line. print_r(category::all());die();

Karl Hill
  • 12,937
  • 5
  • 58
  • 95

1 Answers1

0

Change this line use app\models\category; to this use App\Models\Category;

public function index(){

    print_r(Category::all());die();
    $categories = Category::all();
    return view('frontend.homepage',compact('categories'));

}
Prashant Deshmukh.....
  • 2,244
  • 1
  • 9
  • 11