Beispiel #1
0
 public function run()
 {
     Category::truncate();
     $categories = ['General'];
     foreach ($categories as $category) {
         Category::create(['name' => $category, 'slug' => Str::slug($category)]);
     }
 }
 /**
  * Store a newly created category in storage.
  *
  * @return Response
  */
 public function store(Create $request)
 {
     $data = $request->all();
     $category = Category::create($data);
     return $this->redirect('categories.index');
 }
Beispiel #3
0
 /**
  * Store a newly created category in storage.
  *
  * @return Response
  */
 public function store()
 {
     app('Pingpong\\Admin\\Validation\\Category\\Create')->validate($data = $this->inputAll());
     $category = Category::create($data);
     return $this->redirect('categories.index');
 }