app/Http/Controllers/News/CategoryController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(CategoryRequest $request)
	{
			$title = $request->input('title');
			$slug = $request->input('slug');
			$category = Category::create([
				'title' => $title,
				'slug' => $slug
			]);
			if ($category) {
				return redirect()->route('categories.index')
					->with('success', 'Категория успешно добавлена');
			}
			return back()->with('error', ' Не удалось добавить категорию');
    }
public function store ( CategoryRequest $ request ) { $ title = $ request -> input ( 'title' ) ; $ slug = $ request -> input ( 'slug' ) ; $ category = Category :: create ( [ 'title' => $ title , 'slug' => $ slug ] ) ; if ( $ category ) { return redirect ( ) -> route ( 'categories.index' ) -> with ( 'success' , 'Категория успешно добавлена'); } return back ( ) -> with ( 'error' , ' Не удалось добавить категорию'); }
Store a newly created resource in storage.
Store a newly created resource in storage .