I'm having trouble registering controllers to routes in my package.
As far as I understand from the official documentation I just need to simply prefix it and use my namespace though I always get the error of xyzclass not found.
Anyone could explain to me how can I make this work?
-- Vendor
-- Package
|-- composer.json
|-- composer.lock
|-- public
|-- src
| |-- Vendor
| | -- Package
| | -- PackageServiceProvider.php
| |-- config
| |-- controllers
| | -- MyController.php
| |-- lang
| |-- migrations
| |-- routes.php
| -- views
|-- tests
I loaded my routes.php in my serviceprovider file. I created and index function in MyController.php and assigned it in my routes.php.
Route::contorller('myctrl', 'Vendor\Package\MyController');
And in theory I should be able to access mydomain.com/myctrl and it should give me back what I defined in MyController's index function. But in reality I get an error saying Class Vendor\Package\MyController does not exists. Any advice or help how should this work or how it's working?