mdsatu/switcher

Laravel database table status switcher

Installs: 932

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:Blade

1.5 2023-12-06 13:49 UTC

This package is auto-updated.

Last update: 2025-07-06 17:09:16 UTC


README

Switcher is used to easily switch database column status value of a specific table.

GitHub license, GitHub issues

Requirements

  • PHP 5.4 or above
  • Laravel 5.5 or above

Steps:

Install

Composer

Run the following to include this package via Composer

composer require mdsatu/switcher

Once download is complete, the next thing you have to do is include the service provider within config/app.php.

'providers' => [
        DWK\Switcher\SwitcherServiceProvider::class,
];

Then run php artisan vendor:publish --provider="DWK\Switcher\SwitcherServiceProvider" to get the config of Switcher.

Configuration

Setup default application switcher in switcher.php config. (Optional but recommended)

Available options:

Option Description
default_column Here you may specify the default column name.
loader Here you may specify loader animation (Optional).

Usage

Once configuration is complete you can add this code inside the body tag to activate the "Switcher".

@include('switcher::code')

Now put this code where you want to preview the "Switch"

@include('switcher::switch', [
    'table' => 'users',
    'data' => $query_data,
    'column' => 'status', // Optional
    'id' => 1 // Optional
])

Example

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
    </head>
    <body>
        @include('switcher::switch', [
            'table' => 'users',
            'data' => $query_data
        ])
    </body>
    </html>

Maintainers

This package is maintained by MD Satu and you!

License

This package is licensed under the MIT license.