/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { if ($this->checkProjectPermissions($id) == false) { return ['error' => 'sem permissão']; } return $this->repository->find($id); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { if ($this->checkProjectPermissions($id) == false) { return ['error' => 'Access Forbidden']; } return $this->repository->find($id); }
/** * @param $id * @param array $with * @return array|mixed */ public function show($id) { try { return $this->repository->find($id); } catch (ModelNotFoundException $e) { return ['error' => true, 'message' => 'No data found for id:' . $id]; } }
/** * Bind data to the view. * * @param View $view * @return void */ public function compose(View $view) { $clients = $this->clients->find($view->getData()['client']['id']); /** * [User assigned the client] * @var contact */ $contact = $clients->userAssignee; $view->with('contact', $contact); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { try { if ($this->checkProjectOwner($id) == false) { return ['error' => 'Acesso negado.']; } $this->repository->find($id)->softdelete(); } catch (ModelNotFoundException $e) { return ['error' => true, 'message' => $e->getMessage()]; } }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { return $this->service->find($id); }
public function destroy($id) { $this->repository->find($id)->delete(); }
public function getMembers($id) { return $this->repository->find($id)->members; }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show($id) { return $this->repository->find($id); }