Package Data | |
---|---|
Maintainer Username: | siokas |
Maintainer Contact: | apostolossiokas@gmail.com (Apostolos Siokas) |
Package Create Date: | 2016-08-02 |
Package Last Update: | 2016-08-04 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-01-15 15:03:31 |
Package Statistics | |
---|---|
Total Downloads: | 18 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 3 |
Total Watchers: | 4 |
Total Forks: | 0 |
Total Open Issues: | 0 |
This package helps Laravel users to add routes easily. There will be a yaml on your project in which you have the option to specify the routes. Currently the package provides functionality for simple routes and group routes. The plan for a future update is to include more complex routes with where statements.
The package supports functionality for:
Note: Tested and works fine on Laravel 5.3
Via Composer
composer require siokas/laryr
After the installation you should regirster the ServiceProvider to the config/app.php file. Add the following line in the providers array.
Siokas\Laryr\LaryrServiceProvider::class,
Now you should publish the unpublished files. Open terminal and type:
php artisan vendor:publish
This command will publish a yaml file at the root directory of your app, called routes.yml and a configuration file in config directory called laryr.php.
Open the routes.yml file and enter your application routes in a collection type.
-
route: test
method: get
controller: AppController
function: index
This will create a route which points to the specified Controller and function.
Note 1: If you want to change the name and the path of the routes.yml file, you have to specify the new path and filename in the config/laryr.php file.
Note 2: Nested functions are not supported on the yaml file.
To create a route group you have to add a route with method as group and name your route.
-
method: group
name: groupRoutes
Then you have to create a .yml file in the same directory with the routes.yml file. This file has to have the same name that you spesified in the previous step. To create that file, open the terminal and type the make artisan command:
php artisan make:yaml groupRoutes
In this file you can specify the routes you want in the same way.
There are two options in the routes which are listed below:
name: routeName
middleware: auth
For the route groups there are more available options to specify:
name: test
domain: {account}.app.dev
prefix: user
namespace: UsersAccount
The following link contains a nice fully tutorial on how to use the package to your project: https://www.siokas.com/post/laryr/
The MIT License (MIT). Please see License File for more information.