PHP code example of flamento / magicdb

1. Go to this page and download the library: Download flamento/magicdb library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

flamento / magicdb example snippets


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', ''),
];
bash
php artisan vendor:publish --provider="Flamento\MagicDB\MagicDBServiceProvider"