コード例 #1
0
 public function store(Requests\StoreCategoryRequest $request, $category_id = null)
 {
     $category = Categories::findOrNew($category_id);
     $category->title = strip_tags(Input::get('title'));
     $seo_title = strip_tags(Input::get('seo_title'));
     $category->seo_title = trim($seo_title) == '' ? $category->title : $seo_title;
     $category->seo_description = strip_tags(Input::get('seo_description'));
     $category->seo_keywords = strip_tags(Input::get('seo_keywords'));
     if (Input::has('update_slug')) {
         $category->resluggify();
     }
     $category->save();
     Notifications::add('Category saved', 'success');
     return Redirect::route('root-categories-edit', ['category_id' => $category->id]);
 }