laravel-menu-builder
laravel-menu-builder copied to clipboard
MenuController does not exist
it says "Class App\Http\Controllers\CodexShaper\Menu\Http\Controllers\MenuController does not exist". I had ran php artisan menu:install But still it show error. what does i miss?
@dionajie Thanks for your comment. I just checked and created a demo but there is no like you post. Maybe you used this package wrong way. Please follow the link
https://youtu.be/5hr8b9DR_HU
If not working follow tips.
Tips: If you want to extend the core Controller
or Model
first import after namespace
or use a backslash(\)
before the class namespace. For example
<?php
namespace App\Controllers;
use CodexShaper\Menu\Http\Controllers\MenuController;
class YourController extends MenuController
{}
OR
<?php
namespace App\Controllers;
class YourController extends \CodexShaper\Menu\Http\Controllers\MenuController
{}
You can run extra command composer dump-autoload
If you still face the same issue then reply with code where the error occurred.
Same problem. But worked in clean installation. (new laravel app)
hello @fkaan
When you face the issue? Can you send details? I'll try to assist you to solve this issue.
Thanks
I have also just encountered this error. Running Laravel Framework 7.21.0.
After taking a look, it seems as if you are pulling in the various models from CodexShaper\Menu\Models\...
, yet in the vendor folder, you have called the directory Model
.
A quick fix for me was to just rename the Model directory within the vendor folder to Models. Ran the install command again, and everything was fixed.
Hello @jam1e,
Thanks for your comment. I fixed the models namespace issue. Please make sure you used version 2.4 or later.