Created
February 12, 2017 20:41
-
-
Save evercode1/bd96c8aae5500361bc4b00ccc4dde674 to your computer and use it in GitHub Desktop.
chapter 15 Lesson Controller store method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function store(LessonCreateRequest $request) | |
| { | |
| $slug = str_slug($request->name, "-"); | |
| $widget = Lesson::create(['name' => $request->name, | |
| 'slug' => $slug, | |
| 'category_id' => $request->category_id, | |
| 'subcategory_id' => $request->subcategory_id]); | |
| $widget->save(); | |
| alert()->success('Congrats!', 'You made a Lesson'); | |
| return Redirect::route('lesson.index'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment