コード例 #1
0
 /**
  * Execute a command
  *
  * @param $id
  * @return mixed
  * @throws \Exception
  */
 public function postExecute($id)
 {
     \ruler()->check($this->permission, ['id' => 'required|exists:schedule,schedule_id'], ['id' => $id]);
     try {
         // Récuperation du model
         $schedule = Db\Schedule\Schedule::findOrFail($id);
         \Artisan::call($schedule->command);
         \js()->success()->reloadDataTable();
     } catch (\Exception $e) {
         \js()->error($e->getMessage());
     }
     return \js();
 }