themsaid / laravel-routes-publisher
A command to replace deprecated Route::controller with explicit routes.
Installs: 24 665
Dependents: 0
Suggesters: 0
Security: 0
Stars: 59
Watchers: 4
Forks: 12
Open Issues: 8
pkg:composer/themsaid/laravel-routes-publisher
Requires
- php: >=5.5.9
- illuminate/support: ^5.2
This package is auto-updated.
Last update: 2020-02-05 23:17:23 UTC
README
A command to replace deprecated Route::controller() and Route::controllers() with explicit routes.
In laravel 5.3 implicit controller routes will be removed from the framework, the functionality will likely be extracted into a separate package, however if you'd like to make the move and start using explicit routes this package will help you.
Installation
Step 1:
composer require themsaid/laravel-routes-publisher
Step 2:
Include the following command in your $commands attribute of app/Console/Kernel.php:
\Themsaid\RoutesPublisher\RoutesPublisherCommand::class
Usage
Run the following command:
php artisan themsaid:publishRoutes
After the command is done, two new files will be generated in your app/Http directory:
routes.php.generated
routes.php.backup
Replace the content of your routes.php file with that of routes.php.generated, knowing that if anything went wrong a backup
of your original routes.php's content will be available in routes.php.backup.
This package assumes the following:
- Your
routes.phpdoesn't contain any PHP syntax errors. - Your
routes.phpfile is located inapp\Http\routes.phpwith the exact name. - Your
routes.phpfiles doesn't include any other file usingincludeorrequire. - Your Application namespace is correctly registered in the psr-4 section of
composer.json.
Problems?
I tried hard to cover different syntax and file formatting in this package, however if you found any problems while using the package please open a new issue.