public function store(Requests\StepRequest $request)
 {
     $input = $request->only(['flow_id', 'name', 'description']);
     $input['flow'] = Flow::find($input['flow_id']);
     $step = $this->createStep($input);
     return $this->responseWithItem($step, new StepTransformer());
 }
 /**
  * @param $uuid
  * @return mixed
  */
 public function edit(Board $entity, $uuid)
 {
     $board = Board::byUuid($uuid)->firstOrFail();
     $this->authorize('editBoard', $board);
     $flows = Flow::byModule('tasks')->get()->pluck('name', 'id')->toArray();
     $builder = new EntityFieldsFormBuilder($entity->getEntity());
     $builder->setRowId($board->id);
     return view('tasks::boards.edit')->with('flows', $flows)->with('board', $board)->with('boardFields', $builder->render());
 }
 /**
  * Create the flow in the database
  * @param $command
  * @return static
  */
 public function handle($command)
 {
     $flow = Flow::create((array) $command);
     event(new FlowWasCreated($flow));
     return $flow;
 }
 public function setFlow($id)
 {
     $this->flow = Flow::findOrFail($id);
     return $this;
 }
 public function store(Requests\TransitionRequest $request)
 {
     $transition = $this->createTransition(['flow' => Flow::find($request->get('flow_id')), 'from' => Step::find($request->get('from')), 'to' => Step::find($request->get('to'))]);
     return $this->responseWithItem($transition, new TransitionTransformer());
 }
 /**
  * @param $id
  * @return \Illuminate\Http\RedirectResponse
  */
 public function destroy($id)
 {
     $this->deleteFlow(Flow::findOrFail($id));
     SweetAlert::success('Se ha eliminado el Flujo');
     return redirect()->back();
 }
 /**
  * @param $id
  * @return mixed
  */
 public function destroy($id)
 {
     $this->deleteFlow(Flow::findOrFail($id));
     return $this->responseNoContent();
 }