app/Http/Controllers/TagController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, $id)
    {
        $tag = Tag::find($id);
        $this->validate($request,[
            'tag' => 'required|unique:tags|max:100',
            'user_id' => 'required'
        ]);
        $tag->tag = $request->tag;
        $tag->user_id = $request->user_id; 
        $tag->slug = str_slug($request->tag);
        $tag->save();
        return redirect()->route('tag.index');
    }
public function update ( Request $ request , $ id ) { $ tag = Tag :: find ( $ id ) ; $ this -> validate ( $ request , [ 'tag' => 'required|unique:tags|max:100' , 'user_id' => 'required' ] ) ; $ tag -> tag = $ request -> tag ; $ tag -> user_id = $ request -> user_id ; $ tag -> slug = str_slug ( $ request -> tag ) ; $ tag -> save ( ) ; return redirect ( ) -> route ( 'tag.index' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .