Package Data | |
---|---|
Maintainer Username: | weirongxu |
Maintainer Contact: | weirongxu.raidou@gmail.com (Weirong Xu) |
Package Create Date: | 2016-08-21 |
Package Last Update: | 2019-07-09 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-01-29 03:00:03 |
Package Statistics | |
---|---|
Total Downloads: | 18 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 4 |
Total Watchers: | 2 |
Total Forks: | 2 |
Total Open Issues: | 1 |
Change laravel5 routing into query
Its useful when you can not use .htaccess
Some url transform examples
http://localhost:8000/path
to http://localhost:8080/?_=/path
http://localhost/path/to/?a=1&b=2
to http://localhost/?a=1&b=2&_=/path/to/
Install with composer
composer require weirongxu/laravel-query-route
config/app.php
<?php
Weirongxu\LaravelQueryRoute\ServiceProvider::class,
// Note: The `App\Providers\RouteServiceProvider::class` must before this provider
Weirongxu\LaravelQueryRoute\Request
replace laravel request in public/index.php
<?php
$response = $kernel->handle(
// $request = Illuminate\Http\Request::capture()
$request = Weirongxu\LaravelQueryRoute\Request::capture()
);
php artisan vendor:publish --provider="Weirongxu\\LaravelQueryRoute\\ServiceProvider" --tag config
the underscore path indicator "_" can be customized in config/query-route.php. Set query_name to "rpath" for example:
http://localhost/path/to/?a=1&b=2
to http://localhost/?a=1&b=2&rpath=/path/to/