| @@ 53-66 (lines=14) @@ | ||
| 50 | * |
|
| 51 | * @return \Illuminate\Http\RedirectResponse |
|
| 52 | */ |
|
| 53 | public function create(Request $request): RedirectResponse |
|
| 54 | { |
|
| 55 | ArticleValidator::create($request->all())->validate(); |
|
| 56 | ||
| 57 | if (ArticleRepository::create($request->all())) { |
|
| 58 | return redirect() |
|
| 59 | ->route('admin.blog.article.index') |
|
| 60 | ->with('success', 'Your article has been created successfully !'); |
|
| 61 | } |
|
| 62 | ||
| 63 | return redirect() |
|
| 64 | ->route('admin.blog.article.index') |
|
| 65 | ->with('danger', 'An error occurred while creating your article !'); |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * Show the article update form. |
|
| @@ 49-62 (lines=14) @@ | ||
| 46 | * |
|
| 47 | * @return \Illuminate\Http\RedirectResponse |
|
| 48 | */ |
|
| 49 | public function create(Request $request): RedirectResponse |
|
| 50 | { |
|
| 51 | CategoryValidator::create($request->all())->validate(); |
|
| 52 | ||
| 53 | if (CategoryRepository::create($request->all())) { |
|
| 54 | return redirect() |
|
| 55 | ->route('admin.blog.category.index') |
|
| 56 | ->with('success', 'Your category has been created successfully !'); |
|
| 57 | } |
|
| 58 | ||
| 59 | return redirect() |
|
| 60 | ->route('admin.blog.category.index') |
|
| 61 | ->with('danger', 'An error occurred while creating your category !'); |
|
| 62 | } |
|
| 63 | ||
| 64 | /** |
|
| 65 | * Show the category update form. |
|