|
@@ 101-107 (lines=7) @@
|
| 98 |
|
* @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
| 99 |
|
* @return \Illuminate\Http\Response |
| 100 |
|
*/ |
| 101 |
|
public function findby(Request $request, $sortBy = 'created_at', $desc = 1) |
| 102 |
|
{ |
| 103 |
|
if ($this->repo) |
| 104 |
|
{ |
| 105 |
|
return \Response::json($this->repo->findBy($request->all(), $this->relations, $sortBy, $desc), 200); |
| 106 |
|
} |
| 107 |
|
} |
| 108 |
|
|
| 109 |
|
/** |
| 110 |
|
* Fetch the first record from the storage based on the given |
|
@@ 150-156 (lines=7) @@
|
| 147 |
|
* @param boolean $desc Sort ascending or descinding (1: desc, 0: asc). |
| 148 |
|
* @return \Illuminate\Http\Response |
| 149 |
|
*/ |
| 150 |
|
public function paginateby(Request $request, $perPage = 15, $sortBy = 'created_at', $desc = 1) |
| 151 |
|
{ |
| 152 |
|
if ($this->repo) |
| 153 |
|
{ |
| 154 |
|
return \Response::json($this->repo->paginateBy($request->all(), $perPage, $this->relations, $sortBy, $desc), 200); |
| 155 |
|
} |
| 156 |
|
} |
| 157 |
|
|
| 158 |
|
/** |
| 159 |
|
* Save the given model to storage. |