LaravelPackages.net
Acme Inc.
Toggle sidebar
luminark/url

Luminark URL package.

11
0
0.5.0
About luminark/url

luminark/url is a Laravel package for luminark url package.. It currently has 0 GitHub stars and 11 downloads on Packagist (latest version 0.5.0). Install it with composer require luminark/url. Discover more Laravel packages by luminark or browse all Laravel packages to compare alternatives.

Last updated

#Luminark URL Package

Build Status Code Coverage SensioLabsInsight Scrutinizer

##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', '.*');
Comments