/**
  * Validate the input and store the company department in the database.
  *
  * @param \Illuminate\Http\Request $request
  * @param int $projectId
  *
  * @return Response
  */
 public function store(Request $request, $projectId)
 {
     $project = Project::findOrFail($projectId);
     $this->validate($request, $this->createProjectCompanyDepartmentRules);
     $department = ProjectCompanyDepartment::create(['project_id' => $project->id, 'company_department_id' => $request->input('company_department_id')]);
     if (!isset($department)) {
         abort(503);
     }
     return redirect()->route('project.show', ['project' => $project->id]);
 }
 /**
  * Delete profile field.
  *
  * @param int $projectId
  * @param int $profileId
  *
  * @return Response
  */
 public function destroy($projectId, $profileId)
 {
     $project = Project::findOrFail($projectId);
     $profile = ProjectProfile::findOrFail($profileId);
     $profile->delete();
     return redirect()->route('project.show', ['project' => $project->id]);
 }
Ejemplo n.º 3
0
 /**
  * Move a project to the trash.
  *
  * @param int $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     $project = Project::findOrFail($id);
     $project->delete();
     return redirect()->route('project.index');
 }