app/Http/Controllers/TagsController.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)
    {
        $this->validate($request,[
            'name' => 'required|max:20|min:3'
        ]);
        $tag_data = [
            'name' => $request->name,
            'slug' => Str::slug($request->name)
        ];
        Tags::whereId($id)->update($tag_data);
        return redirect()->route('tag.index')->with('success', 'Data berhasil di update');
    }
public function update ( Request $ request , $ id ) { $ this -> validate ( $ request , [ 'name' => 'required|max:20|min:3' ] ) ; $ tag_data = [ 'name' => $ request -> name , 'slug' => Str :: slug ( $ request -> name ) ] ; Tags :: whereId ( $ id ) -> update ( $ tag_data ) ; return redirect ( ) -> route ( 'tag.index' ) -> with ( 'success' , 'Data berhasil di update' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .