PHPackages                             sparkouttech/laravel-url-rewrites - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sparkouttech/laravel-url-rewrites

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sparkouttech/laravel-url-rewrites
=================================

Easy URL rewrites in your Laravel application

03.8kPHP

Since Mar 19Pushed 2y ago3 watchersCompare

[ Source](https://github.com/sparkouttech/laravel-url-rewrites)[ Packagist](https://packagist.org/packages/sparkouttech/laravel-url-rewrites)[ RSS](/packages/sparkouttech-laravel-url-rewrites/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Easily add URL rewrites to a Laravel app
========================================

[](#easily-add-url-rewrites-to-a-laravel-app)

[![Latest Version on Packagist](https://camo.githubusercontent.com/17b2bffdd43ebda37d2c26564d443048a7a8313f62913a22a26189b69be0ba60/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f727574686765726964656d612f6c61726176656c2d75726c2d72657772697465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ruthgeridema/laravel-url-rewrites)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/60decc188e28cb7ff1fa2f1d57524d7225c1164ad0d12b8098b693cd0475e60e/68747470733a2f2f7472617669732d63692e6f72672f727574686765726964656d612f6c61726176656c2d75726c2d72657772697465732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ruthgeridema/laravel-url-rewrites)[![Quality Score](https://camo.githubusercontent.com/03aa5c0d1c147aa23797d1dbbac152199e3096b815dd74bd6c58bc7d487024fe/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f727574686765726964656d612f6c61726176656c2d75726c2d72657772697465732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/ruthgeridema/laravel-url-rewrites)[![StyleCI](https://camo.githubusercontent.com/6cac679d9228e24c4791071b591e092a64c64e9ed81eb3689fa503c5c9b948ae/68747470733a2f2f7374796c6563692e696f2f7265706f732f3137343338313638352f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/174381685)[![Total Downloads](https://camo.githubusercontent.com/915a45d8eb6fd183c6a27a4347d0c177840e270e67d42b39dd73664a883bc74d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f727574686765726964656d612f6c61726176656c2d75726c2d72657772697465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ruthgeridema/laravel-url-rewrites)

Very easy to use URL rewrite package. Follow the instructions and you're good to go!

You can find an example project on my Github: [view example project](https://github.com/ruthgeridema/laravel-url-rewrites-example)This example project features the following:

- Eloquent observers to add URL rewrites automatically
- Usage of the trait
- Some use cases

Requirements
------------

[](#requirements)

This package requires Laravel 8 or higher, PHP 8.1 or higher and a database that supports json fields and functions such as MySQL 5.7 or higher.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require sparkouttech/laravel-url-rewrites
```

The package will automatically register itself.

Register the routes the feeds will be displayed on using the `rewrites`-macro. You need to place it at the bottom of your routes file.

```
// In routes/web.php
Route::rewrites();
```

You can publish the migration with:

```
php artisan vendor:publish --provider="RuthgerIdema\UrlRewrite\ServiceProvider" --tag="migrations"
```

After the migration has been published you can create the `url_rewrites` table by running the migration:

```
php artisan migrate
```

You can optionally publish the config file with:

```
php artisan vendor:publish --provider="RuthgerIdema\UrlRewrite\ServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
