public function backup($task = 'run')
    {
        if (! in_array($task, ['run', 'clean'])) {
            $message = trans('cms::utilities.backup.not_allowed',
                    ['task' => $task]) . trans('cms::utilities.field.executed_by',
                    ['name' => $this->getCurrentUserName()]);
            $this->log->info($message);

            return $this->notifyError($message);
        }

        Artisan::call('backup:' . $task);
        $message = $task == 'clean' ? trans('cms::utilities.backup.cleanup_complete') : trans('cms::utilities.backup.complete');
        $this->log->info($message . trans('cms::utilities.field.executed_by', ['name' => $this->getCurrentUserName()]));

        return $this->notifySuccess($message);
    }
public function backup($task = 'run')
    {
        if (! in_array($task, ['run', 'clean'])) {
            $message = trans('cms::utilities.backup.not_allowed',
                    ['task' => $task]) . trans('cms::utilities.field.executed_by',
                    ['name' => $this->getCurrentUserName()]);
            $this->log->info($message);

            return $this->notifyError($message);
        }

        Artisan::call('backup:' . $task);
        $message = $task == 'clean' ? trans('cms::utilities.backup.cleanup_complete') : trans('cms::utilities.backup.complete');
        $this->log->info($message . trans('cms::utilities.field.executed_by', ['name' => $this->getCurrentUserName()]));

        return $this->notifySuccess($message);
    }
public function backup ( $ task = 'run' ) { if ( ! in_array ( $ task , [ 'run' , 'clean' ] ) ) { $ message = trans ( 'cms::utilities.backup.not_allowed' , [ 'task' => $ task ] ) . trans ( 'cms::utilities.field.executed_by' , [ 'name' => $ this -> getCurrentUserName ( ) ] ) ; $ this -> log -> info ( $ message ) ; return $ this -> notifyError ( $ message ) ; } Artisan :: call ( 'backup:' . $ task ) ; $ message = $ task == 'clean' ? trans ( 'cms::utilities.backup.cleanup_complete' ) : trans ( 'cms::utilities.backup.complete' ) ; $ this -> log -> info ( $ message . trans ( 'cms::utilities.field.executed_by' , [ 'name' => $ this -> getCurrentUserName ( ) ] ) ) ; return $ this -> notifySuccess ( $ message ) ; }
Execute back up manually.

@param string $task
@return \Illuminate\Http\JsonResponse
Execute back up manually .