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.
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"
To publish the config and translations files, views and migration run this command:
php artisan redirect-panel:publish
To add to the router, please add the following code to the routes/web.php
file.
Route::redirectPanel('laravel-redirect-panel');
Local | Language |
---|---|
en |
English |
fa |
farsi |
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email backend.programer.90@gmail.com
instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.