Package Data | |
---|---|
Maintainer Username: | tohuma |
Maintainer Contact: | tohuma@gmail.com (Miguel Cabada) |
Package Create Date: | 2016-05-02 |
Package Last Update: | 2016-05-05 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-02-01 03:05:36 |
Package Statistics | |
---|---|
Total Downloads: | 17 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Inspired by Laravel Multiple Routes
This package allow grouping routes by namespace, you only need to create a directory with the namespace on "../Http/Controllers/". Also it is necessary to create the file routes.php on that directory.
This package doesn't disable the default routes of Laravel.
PHP 5.5+ Laravel 5.x+ are required
You can install this package quickly and easily with Composer.
Run the following command in your terminal:
composer require tohuma/laravel-routes
Add RouteServiceProvider in config/app.php
'providers' => [
...
Tohuma\Laravel\Routes\Providers\RouteServiceProvider::class,
],
Create directory Blog in App\Http\Controllers.
Create file routes.php in App\Http\Controllers\Blog and add yours routes.
<?php
Route::get('welcome', function () {
return 'Welcome to my blog';
});
Callback in browser
http://<servername>/blog/welcome
Create file BlogController.php in App\Http\Controllers\Blog and add this script.
<?php
namespace App\Http\Controllers\Blog;
use App\Http\Controllers\Controller;
class BlogController extends Controller
{
public function comments()
{
return 'This is my list comments';
}
}
Add in App\Http\Controllers\Blog\routes.php
<?php
...
Route::get('comments', 'BlogController@comments');
Callback
http://<servername>/blog/comments
v1.0.0
Laravel Routes is licensed The MIT License (MIT).