Make sure you've namespaced the AdminController file as you have written in your route, and don't forget to dump the autoloader with
php artisan dump-auto
Let us know if you've already done this.
Thank you jlaswell,
I did
php artisan dump-auto
And it shows:
{"error":{"type":"ReflectionException","message":"Class Vendor\\Package\\AdminController does not exist","file":"\/laravel\/vendor\/laravel\/framework\/src\/Illuminate\/Routing\/ControllerInspector.php","line":28}}
The thing is, my controller is:
- workbench
- vendor
- package
- src
- controllers
- AdminController.php
- vendor
- package
- AdminServiceProvider.php
Is it the path configuration?
Yep, it's just the paths. Folder structure for a workbench package should be as follows.
- workbench
- vendor
- package
- src
- Vendor
- Package
- AdminServiceProvider.php
- AdminController.php
You can also move AdminController.php to it's own controllers folder if you namespace it accordingly!
<?php Vendor/Package/Controllers;
- workbench
- vendor
- package
- src
- Vendor
- Package
- AdminServiceProvider.php
- Controllers
- AdminController.php
Thanks again, it worked.
Then I was trying to replicate the folder structure here: https://github.com/FrozenNode/Laravel-Administrator/tree/master/src
Where controllers are separated from ServiceProvider, wondering if there's anything specific about the structure here. You see, when I tried FrozenNode's structure the 'not-found' error appears.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community