Skip to content

Instantly share code, notes, and snippets.

@evercode1
Created February 12, 2017 20:41
Show Gist options
  • Select an option

  • Save evercode1/bd96c8aae5500361bc4b00ccc4dde674 to your computer and use it in GitHub Desktop.

Select an option

Save evercode1/bd96c8aae5500361bc4b00ccc4dde674 to your computer and use it in GitHub Desktop.
chapter 15 Lesson Controller store method
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