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(Request $request)
    {
        $this->validate($request,[
            'tag' => 'required|unique:tags|max:100',
            'user_id' => 'required'
        ]);
        $tag = Tag::create([
            'tag' => $request->tag,
            'slug' => str_slug($request->tag),
            'user_id' => $request->user_id
        ]);
        return redirect()->back();
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'tag' => 'required|unique:tags|max:100' , 'user_id' => 'required' ] ) ; $ tag = Tag :: create ( [ 'tag' => $ request -> tag , 'slug' => str_slug ( $ request -> tag ) , 'user_id' => $ request -> user_id ] ) ; return redirect ( ) -> back ( ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .