PHP code example of therealsmat / laravel-push-db
1. Go to this page and download the library: Download therealsmat/laravel-push-db 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/ */
therealsmat / laravel-push-db example snippets
public function export(PushDB $db)
{
try{
if ($db->export()) {
return 'Database Export Successful';
}
return 'Database export not successful';
} catch (ProcessFailedException $e)
{
return $e->getMessage();
} catch (\Exception $e)
{
return $e->getMessage();
}
}
/**
* Call the artisan command
*/
Artisan::call('db:push');
/**
* Get the file from the output path
*/
Storage::disk('s3')->put('Database.sql', config('pushdb.output_path'));
$schedule->command('db:push --force')->daily();