I have created a package following the \"Creating a Package\" instructions in the Laravel 4 documentation. After creating the package I have created a \"controllers\" folder
You may try edit your Vendor/Package/composer.json and insert the controllers dir to autoload/classmap:
....
"autoload": {
"classmap": [
"src/migrations",
"src/controllers",
"src/models"
],
"psr-0": {
"Package\\Controller": "src/"
}
}
....
After that, open your terminal and from your package root dir do a composer dump-autoload
Works for me...
have a look into this git article might be of help https://github.com/jaiwalker/setup-laravel4-package
The mistake was including the controllers path in the route. I had the following:
Route::get('/package', 'Vendor\Package\Controllers\HomeController@showWelcome');
The correct usage is:
Route::get('/package', 'Vendor\Package\HomeController@showWelcome');
With the namespace included in the controller:
namespace Vendor\Package;
Controller should extend illuminate:
\Illuminate\Routing\Controllers\Controller
Still can't use the package name (eg: Package::HomeController@showWelcome), but I can using the namespace. yay.
Problem solved.