Download the PHP package pavelzanek/redirections-laravel without Composer
On this page you can find all versions of the php package pavelzanek/redirections-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pavelzanek/redirections-laravel
More information about pavelzanek/redirections-laravel
Files in pavelzanek/redirections-laravel
Package redirections-laravel
Short Description Manage your redirects easily.
License MIT
Informations about the package redirections-laravel
Redirections for Laravel
Manage your redirects easily. This package provides an easy way to integrate a redirection tool to your Laravel application.
- How it works
- Installations
- Migrations
- Config
- Optional
- Views
- Translations
- Pruning Table
- Events
- Todos
- Testing
- Security
- Chnagelog
- License
How it works
You can manage redirects in your Laravel application. Once installed, you can create, edit, and delete redirects without the need to install additional packages.
There is a lot of consideration for application performance. The tool caches the redirect information, specifically the source url. With each request to the server, the middleware will run, which will determine whether the requested url address is not listed in the cache. If it is found here, a query will be made to the database, which will find the target url address. Meanwhile, an event is dispatched and the associated queued event listener takes care of storing the additional redirection information.
Don't forget to run php artisan queue:work
, php artisan horizon
or something else what you use.
It may happen that the redirection will be unused over time, or completely unused - and records will also remain in the database. For these cases, you can schedule a command that will automatically take care of cleaning the database from unused records.
Furthermore, the tool includes functions such as easy import and export of redirects, graphs of the usability of redirects, etc.
Installations
Source URLs are cached. Check if your project has cache settings
configured. You can use from several prepared drivers (file, Redis, ...). Package also requires PHP 8.1
at least.
Migrations
First of all, generate and customize migration files. It can be useful, if you want to add someting (for example - some realationships).
Config file
Optional
Views
If you want to change design of the app, you can generate views. The tool contains several pre-made templates for different CSS frameworks. Now available:
- Bootstrap 4
- Bootstrap 5
- Tailwind CSS
Translations
Also you can generate translations files.
Pruning table with redirects
You can prune your table with redirects. There is the command for do that:
Alternatively you can schedule this command in your kernel file (app/Console/Kernel.php):
Events
If someone uses a redirect (that is, goes to the source URL), the RedirectWasUsedEvent
event is fired. So you can hook your own listener if needed.
Name | Class |
---|---|
RedirectWasUsedEvent | PavelZanek\RedirectionsLaravel\Events\RedirectWasUsedEvent |
Todos
- ✅ Publish the package
- ✅ List of redirects - fulltext
- ✅ List of redirects - pagination
- ✅ Disable editing Source URL
- ✅ Factory
- ✅ Add more tests
- ✅ Import / Export redirects
- ✅ Toasts / Flash Messages
- ⬜️ Regex Support
- ✅ Bootstrap 5 CSS Support
- ✅ Tailwind CSS Support
- ⬜️ More info about redirects (referer, ...)
Testing
The tool includes several tests for easier scalability.
Security
If you've found a bug regarding security please mail [email protected] instead of using the issue tracker.
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
Copyright (c) Pavel Zaněk. MIT Licensed, see LICENSE for details.