Package Data | |
---|---|
Maintainer Username: | mvrkljan |
Maintainer Contact: | mvrkljan@gmail.com (Martin Vrkljan) |
Package Create Date: | 2015-12-07 |
Package Last Update: | 2015-12-30 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-21 15:00:10 |
Package Statistics | |
---|---|
Total Downloads: | 11 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
#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', '.*');