- wip
This commit is contained in:
@@ -29,12 +29,19 @@ class CategoryController
|
||||
|
||||
public function store(CategoryRequest $request)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
if ($category = $this->categoryRepository->create($validate)) {
|
||||
return redirect()->route('admin.category.update', ['category' => $category])->with('message', 'Utworzono kategorię!');
|
||||
}
|
||||
// $validate = $request->validated();
|
||||
// if ($category = $this->categoryRepository->create($validate)) {
|
||||
// return redirect()
|
||||
// ->route('admin.category.update', compact('category'))
|
||||
// ->with('message', 'Utworzono kategorię!');
|
||||
// }
|
||||
|
||||
return back()->withError(['message_error', 'Wystąpił błąd podczas tworzenia!']);
|
||||
// return back()->withError(['message_error', 'Wystąpił błąd podczas tworzenia!']);
|
||||
|
||||
$category = $this->categoryRepository->create($request->validated());
|
||||
return redirect()
|
||||
->route('admin.category.update', compact('category'))
|
||||
->with('message', 'Utworzono kategorię!');
|
||||
}
|
||||
|
||||
public function create(): View
|
||||
|
Reference in New Issue
Block a user