| @@ 44-51 (lines=8) @@ | ||
| 41 | /** |
|
| 42 | * @return \Illuminate\Database\Eloquent\Collection |
|
| 43 | */ |
|
| 44 | public function all() |
|
| 45 | { |
|
| 46 | if (method_exists($this->model, 'translations')) { |
|
| 47 | return $this->model->with('translations')->orderBy('created_at', 'DESC')->get(); |
|
| 48 | } |
|
| 49 | ||
| 50 | return $this->model->orderBy('created_at', 'DESC')->get(); |
|
| 51 | } |
|
| 52 | ||
| 53 | /** |
|
| 54 | * @return \Illuminate\Pagination\LengthAwarePaginator |
|
| @@ 56-63 (lines=8) @@ | ||
| 53 | /** |
|
| 54 | * @return \Illuminate\Pagination\LengthAwarePaginator |
|
| 55 | */ |
|
| 56 | public function paginate($perPage = 15) |
|
| 57 | { |
|
| 58 | if (method_exists($this->model, 'translations')) { |
|
| 59 | return $this->model->with('translations')->orderBy('created_at', 'DESC')->paginate($perPage); |
|
| 60 | } |
|
| 61 | ||
| 62 | return $this->model->orderBy('created_at', 'DESC')->paginate($perPage); |
|
| 63 | } |
|
| 64 | ||
| 65 | /** |
|
| 66 | * @param mixed $data |
|