NeoZeroSeer

Error: Call to undefined method Modules\Article\Http\Controllers\Backend\CategoriesController::all()

laravel Icon

Error

Call to undefined method Modules\Article\Http\Controllers\Backend\CategoriesController::all()

An unhandled exception occurred on line 26
23
        $authors = Author::where('a_la_une', '1')
24
            ->join('userprofiles', 'user_id', '=', 'users.id')
25
            ->get();
26
        $categories = CategoriesController::all();
27
        return view('frontend.index', compact('featured', 'authors','categories'));
28
    }

Solution

Changed the name of the variable in the blade file            
Apr 10, 2021 Anyone

1 replies


Darkur

What do you exactly mean by 'change variable in the blade file'. I changed this and it gave me another error.


Install the browser extension

Found this solution helpful? Try our extension for quick solutions to your Laravel errors.

Chrome logo Add to Chrome - It's free