|
@@ 57-64 (lines=8) @@
|
| 54 |
|
* @param integer $id |
| 55 |
|
* @return \Illuminate\Http\Response |
| 56 |
|
*/ |
| 57 |
|
public function find($id) |
| 58 |
|
{ |
| 59 |
|
if ($this->model) |
| 60 |
|
{ |
| 61 |
|
$relations = $this->relations && $this->relations['find'] ? $this->relations['find'] : []; |
| 62 |
|
return \Response::json(call_user_func_array("\Core::{$this->model}", [])->find($id, $relations), 200); |
| 63 |
|
} |
| 64 |
|
} |
| 65 |
|
|
| 66 |
|
/** |
| 67 |
|
* Paginate all records with relations from model repository |
|
@@ 110-117 (lines=8) @@
|
| 107 |
|
* @param \Illuminate\Http\Request $request |
| 108 |
|
* @return \Illuminate\Http\Response |
| 109 |
|
*/ |
| 110 |
|
public function first(Request $request) |
| 111 |
|
{ |
| 112 |
|
if ($this->model) |
| 113 |
|
{ |
| 114 |
|
$relations = $this->relations && $this->relations['first'] ? $this->relations['first'] : []; |
| 115 |
|
return \Response::json(call_user_func_array("\Core::{$this->model}", [])->first($request->all(), $relations), 200); |
| 116 |
|
} |
| 117 |
|
} |
| 118 |
|
|
| 119 |
|
/** |
| 120 |
|
* Paginate all records with relations from model repository. |