コード例 #1
0
 /**
  * @param $id
  * @return \Illuminate\Http\JsonResponse|mixed
  */
 public function show($id)
 {
     try {
         return $this->repository->hidden(['owner_id', 'client_id'])->with(['owner', 'client'])->find($id);
     } catch (ModelNotFoundException $e) {
         return response()->json([$e->getMessage()], 404);
     }
     //QueryException tratado em Exceptions/Handler.php
 }
コード例 #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return $this->repository->hidden(['owner_id', 'client_id'])->with(['owner', 'client'])->all();
 }