backendprogramer/laravel-redirect-panel

A panel for adding redirects to the `.htaccess` file.

1.0.0 2023-10-11 20:01 UTC

This package is auto-updated.

Last update: 2024-10-08 19:22:20 UTC


README

SnappPay

Management panel for .htaccess file redirects.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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.

PREVIEW

English Version Persian Version