app/Http/Controllers/CommunicationCategoryController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\CommunicationCategory  $communicationCategory
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(CommunicationCategoryRequest $request, CommunicationCategory $communicationcategory)
    {
        $this->validate($request, [
            'category_code' => 'required',
            'category_description' => 'required',
            'category_group_id' => 'required',
        ]);
        $communicationcategory = CommunicationCategory::find($communicationcategory->id);
        $communicationcategory->category_code = $request->input('category_code');
        $communicationcategory->category_description = $request->input('category_description');
        $communicationcategory->category_group_id = $request->input('category_group_id');
        $communicationcategory->save();
        return redirect()->route('c4s category')->withStatus(__('Category Successfully Updated.'));
    }
public function update ( CommunicationCategoryRequest $ request , CommunicationCategory $ communicationcategory ) { $ this -> validate ( $ request , [ 'category_code' => 'required' , 'category_description' => 'required' , 'category_group_id' => 'required' , ] ) ; $ communicationcategory = CommunicationCategory :: find ( $ communicationcategory -> id ) ; $ communicationcategory -> category_code = $ request -> input ( 'category_code' ) ; $ communicationcategory -> category_description = $ request -> input ( 'category_description' ) ; $ communicationcategory -> category_group_id = $ request -> input ( 'category_group_id' ) ; $ communicationcategory -> save ( ) ; return redirect ( ) -> route ( 'c4s category' ) -> withStatus ( __ ( 'Category Successfully Updated.' ) ) ; }
Update the specified resource in storage.
Update the specified resource in storage .