rollback() public method

public rollback ( integer $model_id, string $reason = '', array $optional = [] ) : Model
$model_id integer
$reason string
$optional array
return Illuminate\Database\Eloquent\Model
 /**
  * Loads a previous deployment and then creates a new deployment based on it.
  *
  * @param Request $request
  * @param int $deployment_id
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function rollback(Request $request, $deployment_id)
 {
     $optional = [];
     // Get the optional commands and typecast to integers
     if ($request->has('optional') && is_array($request->get('optional'))) {
         $optional = array_filter(array_map(function ($value) {
             return filter_var($value, FILTER_VALIDATE_INT);
         }, $request->get('optional')));
     }
     $deployment = $this->deploymentRepository->rollback($deployment_id, $request->get('reason'), $optional);
     return redirect()->route('deployments', ['id' => $deployment->id]);
 }