Download the PHP package vaened/laravel-route-moduler without Composer
On this page you can find all versions of the php package vaened/laravel-route-moduler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-route-moduler
Laravel Route Moduler
Separate laravel routes by modules and submodules
Installation
Laravel Route Moduler requires PHP 8.2. To get the latest version, simply require the project using Composer:
Now. Publish the configuration file.
Usage
Once the library is installed, you can start organizing your routes within the /routes/modules folder, which is the default location. If you prefer a different location, you can update it in the route-modules.php configuration file.
Multiple Modules
The route-modules.php configuration file returns an array for a single module setup. However, you can configure as many modules as you need by extending this array.
This structure helps to keep your application’s routes organized, making maintenance and scalability easier.
Configuration
You can customize the behavior of the laravel-route-moduler
package through the route-modules.php configuration file. Below are the available options:
• path: Specifies where the route configuration files for the module are located. You can set this to a directory or a single file.
Example:
Load all routes in a directory: 'path' => 'routes/modules'
Single route file: 'path' => 'routes/users.php'
• prefix: Adds a prefix to the module path when the module is created, helping to make modules independent and supplement filename prefixes.
Example:
'prefix' => 'admin'
• named: If true, the route file name will be used as a prefix for the routes defined in that file.
Example:
If the file is users.php, all routes will be prefixed with users.
• middleware: Defines the default middleware applied to all routes registered by the module.
Example:
'middleware' => ['web', 'auth']
These settings allow you to tailor the package to your application’s specific routing needs.
License
This library is licensed under the MIT License. For more information, please see the license
file.