luminark / url
Luminark URL package.
0.5.0
2015-12-14 22:36 UTC
Requires
- illuminate/database: 5.*
- illuminate/support: 5.*
- nesbot/carbon: ^1.21
- symfony/http-kernel: ^2.6
Requires (Dev)
- orchestra/testbench: 3.0.*
- phpunit/phpunit: 4.*
This package is not auto-updated.
Last update: 2024-11-09 19:19:30 UTC
README
#Luminark URL Package
##Installation
composer require luminark/url
Add service provider to your config/app.php
:
Luminark/Url/UrlServiceProvider::class,
##Resource Model
Have the Eloquent model URLs will be pointing to use the Luminark/Url/Traits/HasUrlTrait
trait and implement the Luminark/Url/Interfaces/HasUrlInterface
interface.
##Resource Controller
The controller which will be handling URLs needs to use the Luminark/Url/Traits/HandlesUrlTrait
trait and extend the getUrlResourceResponse(Url $url)
method which receives the requested Url
model.
In your routes.php
(at the bottom) add a wildcard route handler which uses getUrlResource
method. E.g.:
Route::get('{uri?}', ['uses' => 'UrlController@getUrlResource'])->where('uri', '.*');