app/Http/Controllers/CommoCategoryController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\CommoCategory  $commoCategory
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(CommoCategoryRequest $request, CommoCategory $commocategory)
    {
        $this->validate($request, [
            'commo_code' => 'required',
            'commo_category' => 'required',
            'commo_desc' => 'required',
            'category_group_id' => 'required',
            'category_id' => 'required',
        ]);
        $commocategory = CommoCategory::find($commocategory->id);
        $commocategory->commo_code = $request->input('commo_code');
        $commocategory->commo_category = $request->input('commo_category');
        $commocategory->commo_desc = $request->input('commo_desc');
        $commocategory->category_group_id = $request->input('category_group_id');
        $commocategory->category_id = $request->input('category_id');
        $commocategory->save();
        return redirect()->route('c4s commo category')->withStatus(__('Commo Category Successfully Updated.'));
    }
public function update ( CommoCategoryRequest $ request , CommoCategory $ commocategory ) { $ this -> validate ( $ request , [ 'commo_code' => 'required' , 'commo_category' => 'required' , 'commo_desc' => 'required' , 'category_group_id' => 'required' , 'category_id' => 'required' , ] ) ; $ commocategory = CommoCategory :: find ( $ commocategory -> id ) ; $ commocategory -> commo_code = $ request -> input ( 'commo_code' ) ; $ commocategory -> commo_category = $ request -> input ( 'commo_category' ) ; $ commocategory -> commo_desc = $ request -> input ( 'commo_desc' ) ; $ commocategory -> category_group_id = $ request -> input ( 'category_group_id' ) ; $ commocategory -> category_id = $ request -> input ( 'category_id' ) ; $ commocategory -> save ( ) ; return redirect ( ) -> route ( 'c4s commo category' ) -> withStatus ( __ ( 'Commo Category Successfully Updated.' ) ) ; }
Update the specified resource in storage.
Update the specified resource in storage .