flamento/magicdb

A database manager that you can attach to your Laravel application.

Installs: 10

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

Language:Blade

v1.0.2 2022-12-04 11:59 UTC

This package is auto-updated.

Last update: 2024-05-04 15:21:45 UTC


README

Latest Version Total Downloads

Magic DB is a database manager that you can easily integrate to your Laravel application.

  • Easy access to your database via /magicdb/login route.
  • Perform SQL and CRUD operations on your tables.
  • Automatic Daily Backup of your database (.gzip file).
  • Download a backup copy of your database.

Magic DB Login Page

Magic DB Table View

Installation

The recommended way to install Magic DB is via Composer.

composer require flamento/magicdb

Configuration

Publish the configuration file

php artisan vendor:publish --provider="Flamento\MagicDB\MagicDBServiceProvider"

Content of the configuration file

return [
    'middleware' => ['web'],
    /* 2 request per 5 minutes for backup endpoint*/
    'backup_throtlle' => 'throttle:2,5,magicdb_backup',
    /* 2 request per minute for login/logout endpoint*/
    'auth_throttle' => 'throttle:2,1,magicdb_auth',

    /* If Magic DB should backup every day, > .gzip saved in storage/app/magicdb/backup  */
    'backup_daily' => true,

    /* Credential to access Magic DB via /magicdb/login page*/
    'MAGICDB_USERNAME' => env('MAGICDB_USERNAME', 'admin'),
    'MAGICDB_PASSWORD' => env('MAGICDB_PASSWORD', 'admin'),

    /* Your database settings */
    'DB_USERNAME' => env('DB_USERNAME', 'root'),
    'DB_PASSWORD' => env('DB_PASSWORD', ''),
    'DB_HOST' => env('DB_HOST', 'localhost'),
    'DB_DATABASE' => env('DB_DATABASE', ''),
];

Setting up Cron Job

For Linux Server

If you wish to have a daily backup of your database, you need to setup a cron job.

* * * * * php /path-to-your-project/artisan schedule:run 1>> /dev/null 2>&1

OR

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

For Windows Server

Please use Task Scheduler available in Windows.

To find out more about setting up a cron job, please visit Laravel Task Scheduler to setup a cron job.

Supported Versions

Magic DB is supported on Laravel 7.0 and above as well as PHP 7.2 and above. This is as far as I can test, but it may work on older versions. However, this library is not meant to be used on older versions of Laravel and PHP except on the versions mentioned above.

Security

If you discover a security vulnerability within this package, please send an email to akosiyawin@gmail.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced.

License

Magic DB is open-sourced software licensed under the MIT license.