app/Http/Controllers/TagController.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(StoreTagRequest $request)
    {
        if ($request->validated()){
            Tag::create($request->validated());
            return redirect()->route('tags.index')->with('message','Tag Created');
        }else{
            return redirect()->route('tags.index')->withErrors($request->validated());
        }
    }
public function store ( StoreTagRequest $ request ) { if ( $ request -> validated ( ) ) { Tag :: create ( $ request -> validated ( ) ) ; return redirect ( ) -> route ( 'tags.index' ) -> with ( 'message' , 'Tag Created' ) ; } else { return redirect ( ) -> route ( 'tags.index' ) -> withErrors ( $ request -> validated ( ) ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .
//