laravel-menu-builder icon indicating copy to clipboard operation
laravel-menu-builder copied to clipboard

MenuController does not exist

Open dionajie opened this issue 5 years ago • 5 comments

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 avatar Jan 26 '20 15:01 dionajie

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

maab16 avatar Jan 27 '20 01:01 maab16

Same problem. But worked in clean installation. (new laravel app)

ghost avatar May 06 '20 18:05 ghost

hello @fkaan

When you face the issue? Can you send details? I'll try to assist you to solve this issue.

Thanks

maab16 avatar May 06 '20 23:05 maab16

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.

jam1e avatar Aug 15 '20 17:08 jam1e

Hello @jam1e,

Thanks for your comment. I fixed the models namespace issue. Please make sure you used version 2.4 or later.

maab16 avatar Aug 16 '20 00:08 maab16