예제 #1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $tables = explode(',', $this->option('tables'));
     try {
         $backup = new BackupDBTable($tables);
         $savedResponse = $backup->saveToCSV(storage_path() . '/db-backups/');
         return $this->sendMessageToCLI($savedResponse);
     } catch (Exception $e) {
         $this->error($e->getMessage());
     }
 }
예제 #2
0
파일: routes.php 프로젝트: rleger/TheseEcho
<?php

use These\Admin\Database\BackupDBTable;
$router->get('csv', function ($table = ['answers', 'failed_jobs']) {
    $backup = new BackupDBTable($table);
    return $backup->saveToCSV(storage_path() . '/db-backups/');
});
//////////////////
// Static Pages //
//////////////////
$router->get('/', ['as' => 'home', 'uses' => 'PagesController@home']);
/////////////////
// City search //
/////////////////
$router->get('city/{search?}', 'CityController@show');
//////////////////
// Mailing list //
//////////////////
$router->get('subscribe/med-centers/all', ['as' => 'subscribe.medcenters.all', 'uses' => 'SubscriptionController@importCentersInNewsletterManager']);
$router->post('subscribe/{toWhat?}', ['as' => 'subscribe.answerer', 'uses' => 'SubscriptionController@subscribeAnswerer']);
$router->post('unsubscribe/{fromWhat?}', ['as' => 'unsubscribe.answerer', 'uses' => 'SubscriptionController@unSubscribeAnswerer']);
///////////////////
// Questionnaire //
///////////////////
$router->get('answer/{token?}', ['as' => 'survey.index', 'uses' => 'SurveyController@index']);
$router->post('answer', 'SurveyController@store');
$router->get('thankyou', ['as' => 'answer.saved', 'uses' => 'PagesController@thankyou']);
/////////////
// Results //
/////////////
$router->get('results', ['as' => 'results.index', 'uses' => 'ResultsController@index']);