backendprogramer / laravel-redirect-panel
A panel for adding redirects to the `.htaccess` file.
Requires
- php: ^8.1
- illuminate/contracts: ^10.0
- livewire/livewire: ^3.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8
- orchestra/testbench: ^8.8
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- pestphp/pest-plugin-livewire: ^2.1
This package is auto-updated.
Last update: 2024-11-08 19:31:47 UTC
README
Management panel for .htaccess file redirects.
The Redirect Panel provides the capability to manage redirects in the .htaccess file. The Redirect Panel creates a table in the database, and every redirect added is stored both in the database and in the .htaccess file. When you edit or delete a redirect, the changes are also applied to the .htaccess file.
Installation
You can install the package via composer:
composer require backendprogramer/laravel-redirect-panel
You can publish and run the migrations with:
php artisan vendor:publish --tag="laravel-redirect-panel-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="laravel-redirect-panel-config"
This is the contents of the published config file:
return [ /* ----------------------------------------------------------------- | htaccess file path | ----------------------------------------------------------------- | Addressing should be done from the path of the public folder like "../../folder/.htaccess" */ 'htaccess' => '.htaccess', /* ----------------------------------------------------------------- | Locale | ----------------------------------------------------------------- | Supported locales : | 'auto', 'en', 'fa' */ 'locale' => 'auto', /* ----------------------------------------------------------------- | Direction | ----------------------------------------------------------------- | Supported directions : | 'ltr','rtl' */ 'direction' => 'ltr', /* ----------------------------------------------------------------- | redirects per page | ----------------------------------------------------------------- | This defines how many redirects are displayed per page. */ 'per-page' => 10, /* ----------------------------------------------------------------- | Colors | ----------------------------------------------------------------- | You can change color of these classes : | btn-primary, btn-danger, btn-success, btn-secondary, text-danger */ 'colors' => [ // 'fg-color' => [ // 'btn-primary' => '', // 'btn-danger' => '', // 'btn-success' => '', // 'btn-secondary' => '', // 'text-danger' => '', // ], // 'bg-color' => [ // 'btn-primary' => '', // 'btn-danger' => '', // 'btn-success' => '', // 'btn-secondary' => '', // ], // 'border-color' => [ // 'btn-primary' => '', // 'btn-danger' => '', // 'btn-success' => '', // 'btn-secondary' => '', // ], ], ];
Optionally, you can publish the views using
php artisan vendor:publish --tag="laravel-redirect-panel-views"
Optionally, you can publish the lang using
php artisan vendor:publish --tag="laravel-redirect-panel-lang"
Artisan commands
To publish the config and translations files, views and migration run this command:
php artisan redirect-panel:publish
Usage
To add to the router, please add the following code to the routes/web.php
file.
Route::redirectPanel('laravel-redirect-panel');
Supported localizations
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email backend.programer.90@gmail.com
instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.