app/Http/Controllers/Backend/AdminController.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)
    {
         if($request->password != ''){
            Admin::where('id', $id)->update([
                'name' =>$request->name,
                'email' =>$request->email,
                'password' =>Hash::make($request['password']),
                'is_super' =>true,
            ]);
        }
        else{
            Admin::where('id', $id)->update([
                'name' =>$request->name,
                'email' =>$request->email,
                'is_super' =>true,
            ]);            
        }
        return redirect()->route('backend.admin.index')->with('message', 'Admin Update Successfully!');
    }
public function update ( Request $ request , $ id ) { if ( $ request -> password != '' ) { Admin :: where ( 'id' , $ id ) -> update ( [ 'name' => $ request -> name , 'email' => $ request -> email , 'password' => Hash :: make ( $ request [ 'password' ] ) , 'is_super' => true , ] ) ; } else { Admin :: where ( 'id' , $ id ) -> update ( [ 'name' => $ request -> name , 'email' => $ request -> email , 'is_super' => true , ] ) ; } return redirect ( ) -> route ( 'backend.admin.index' ) -> with ( 'message' , 'Admin Update Successfully!' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .