Example #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(MinuteRequest $request)
 {
     $minute = new Minute($request->all());
     $project = $this->projectRepository->findOrFail($minute->project_id);
     $minute->code = $project;
     $minute->meeting_at = $request->get('meeting_at');
     dd($minute);
     $minute->save();
     // Add members to project
     $members = $request->get('employee_id');
     $this->addMembers($members, $project);
     Session::flash('success', 'Se agregó correctamente');
     return redirect()->route('admin.projects.edit', $project->id);
 }
Example #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param int $id
  *
  * @return Response
  */
 public function destroy($id, Request $request)
 {
     $project = $this->projectRepository->findOrFail($id);
     $success = $project->delete();
     if ($request->ajax()) {
         return response()->json(compact('success'));
     }
     Session::flash('danger', 'Se eliminó correctamente');
     return redirect()->route('admin.projects.index');
 }