app/Http/Controllers/BrandController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\Brand  $brand
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request,Brand  $brand)
    {   
        $request->validate([
            'brand_name' => ['required'],
            'slug' => ['required'],
        ]);
        $brand->brand_name = $request->brand_name;
        $brand->slug = Str::slug($request->slug);
        $brand->save();
        return back()->with('success','Brand Updated Successfully');
    }
public function update ( Request $ request , Brand $ brand ) { $ request -> validate ( [ 'brand_name' => [ 'required' ] , 'slug' => [ 'required' ] , ] ) ; $ brand -> brand_name = $ request -> brand_name ; $ brand -> slug = Str :: slug ( $ request -> slug ) ; $ brand -> save ( ) ; return back ( ) -> with ( 'success' , 'Brand Updated Successfully' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .