app/Http/Controllers/Backend/CategoriesController.php 1 location
|
@@ 122-131 (lines=10) @@
|
| 119 |
|
return redirect()->route('backend.categories.index'); |
| 120 |
|
} |
| 121 |
|
|
| 122 |
|
public function resource(Request $request) |
| 123 |
|
{ |
| 124 |
|
$categories = Category::select('*'); |
| 125 |
|
|
| 126 |
|
if ($request->has('q')) { |
| 127 |
|
$categories->where('name', 'like', "%{$request->q}%"); |
| 128 |
|
} |
| 129 |
|
|
| 130 |
|
return CategoryResource::collection($categories->orderBy('name')->paginate($this->pagination)); |
| 131 |
|
} |
| 132 |
|
} |
| 133 |
|
|
app/Http/Controllers/Backend/PostsController.php 1 location
|
@@ 132-141 (lines=10) @@
|
| 129 |
|
return redirect()->route('backend.posts.index'); |
| 130 |
|
} |
| 131 |
|
|
| 132 |
|
public function resource(Request $request) |
| 133 |
|
{ |
| 134 |
|
$posts = Post::with('tags'); |
| 135 |
|
|
| 136 |
|
if ($request->has('q')) { |
| 137 |
|
$posts->searchLike($request->q); |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
return PostResource::collection($posts->orderBy('published_at', 'DESC')->paginate($this->pagination)); |
| 141 |
|
} |
| 142 |
|
} |
| 143 |
|
|
app/Http/Controllers/Backend/TagsController.php 1 location
|
@@ 31-40 (lines=10) @@
|
| 28 |
|
]; |
| 29 |
|
} |
| 30 |
|
|
| 31 |
|
public function resource(Request $request) |
| 32 |
|
{ |
| 33 |
|
$tags = Tag::select('*'); |
| 34 |
|
|
| 35 |
|
if ($request->has('q')) { |
| 36 |
|
$tags->where('name', 'like', "%{$request->q}%"); |
| 37 |
|
} |
| 38 |
|
|
| 39 |
|
return TagResource::collection($tags->orderBy('name')->paginate($this->pagination)); |
| 40 |
|
} |
| 41 |
|
} |
| 42 |
|
|
app/Http/Controllers/Backend/ThemesController.php 1 location
|
@@ 144-153 (lines=10) @@
|
| 141 |
|
return redirect()->route('backend.themes.index'); |
| 142 |
|
} |
| 143 |
|
|
| 144 |
|
public function resource(Request $request) |
| 145 |
|
{ |
| 146 |
|
$themes = Theme::select('*'); |
| 147 |
|
|
| 148 |
|
if ($request->has('q')) { |
| 149 |
|
$themes->where('name', 'like', "%{$request->q}%"); |
| 150 |
|
} |
| 151 |
|
|
| 152 |
|
return ThemeResource::collection($themes->orderBy('selected', 'DESC')->orderBy('name')->paginate($this->pagination)); |
| 153 |
|
} |
| 154 |
|
} |
| 155 |
|
|