test
This commit is contained in:
@@ -24,11 +24,11 @@ class Controller extends ExController
|
||||
public function index()
|
||||
{
|
||||
$this->authorize('view', 'categories');
|
||||
$categories = Category::select('id', 'name->ru as category', 'position', 'parent_id')
|
||||
$categories = Category::select('id', 'name->ru as category', 'position', 'parent_id', 'image')
|
||||
->where('parent_id', null)
|
||||
->with(['children' => function ($parent) {
|
||||
return $parent->select('id', 'name->ru as category', 'parent_id', 'position')->orderBy('position', 'asc')->with(['children' => function ($parent) {
|
||||
return $parent->select('id', 'name->ru as category', 'parent_id', 'position')->orderBy('position', 'asc');
|
||||
return $parent->select('id', 'name->ru as category', 'parent_id', 'position', 'image')->orderBy('position', 'asc')->with(['children' => function ($parent) {
|
||||
return $parent->select('id', 'name->ru as category', 'parent_id', 'position', 'image')->orderBy('position', 'asc');
|
||||
}]);
|
||||
}])->orderBy('position', 'asc')->get();
|
||||
|
||||
@@ -102,11 +102,7 @@ class Controller extends ExController
|
||||
return view('dashboard.category.update', compact('parent_categories', 'category', 'brands'));
|
||||
}
|
||||
|
||||
if ($request->hasFile('image')) {
|
||||
$image = $request->file('image')->store('uploads/categories', 'local');
|
||||
} else {
|
||||
$image = $category->image;
|
||||
}
|
||||
$image = $request->getImage($category);
|
||||
|
||||
$this->dispatchSync(new UpdateJob($category, $request, $image));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user