Ejemplo n.º 1
0
 /**
  * @param array $with
  * @return array|mixed
  */
 public function index($id)
 {
     try {
         return $this->repository->with(['project'])->findWhere(['project_id' => $id]);
     } catch (ValidatorException $e) {
         return ['error' => true, 'message' => $e->getMessageBag()];
     } catch (FatalErrorException $e) {
         return ['error' => true, 'message' => $e->getMessage()];
     }
 }
Ejemplo n.º 2
0
 public function showMember($id)
 {
     try {
         return $this->repository->with('members')->find($id);
     } catch (ModelNotFoundException $e) {
         return ['error' => true, 'message' => $e->getMessage()];
     }
 }