Route macro that easily loads a route file without unnecessary method calls.
This package allows you to load a routes file directly from the Laravel
This package requires Laravel 5.7 or higher.
Due to Laravel 7's PHP version requirement, if you need support for PHP 7.1, please use version 0.2 of the package.
You can install this macro via composer:
composer require kirschbaum-development/laravel-route-file-macro
Route::file accepts a single file path or
SplFileInfo object and cannot be used with multiple paths or file objects.
Route::file(base_path('routes/admin/users.php')); $files = File::files(__DIR__.'/routes'); Route::files($files);
Route::files accepts an array of file paths or an array of
SplFileInfo objects and cannot be used with a single path or file object.
Route::files([ base_path('routes/admin/posts.php'), base_path('routes/admin/users.php') ]); $files = File::files(__DIR__.'/routes'); Route::files($files);
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.