app/Http/Controllers/Admin/ClientDetailsController.php
/**
     * Update info for user side.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  ClientDetail  $clientDetail
     * @return \Illuminate\Http\Response
     */
Update info for user side.
Update info for user side .
public function updateInfo(Request $request, ClientDetail $clientDetail)
    {
        if(!Auth::guard('admin')->user())
            return abort(404);
        $request->validate(
            [
                'name' => 'required',
                'email' => 'required|email|unique:client_details,email,'.$clientDetail->id,
                'business_name' => 'required',
                'cnpj' => 'required',
                'address' => 'required',
                'bank_name' => 'required',
                'bank_proxy' => 'required',
                'bank_confirm' => 'required',
                'cpf_cnpj' => 'required'
            ]
        );
        $clientDetail->email = $request->email;
        $clientDetail->name = $request->name;
        $clientDetail->business_name = $request->business_name;
        $clientDetail->cnpj = $request->cnpj;
        $clientDetail->address = $request->address;
        $clientDetail->phone_number = $request->phone;
        $clientDetail->bank_name = $request->bank_name;
        $clientDetail->bank_proxy_name = $request->bank_proxy;
        $clientDetail->bank_cpf_cnpj = $request->cpf_cnpj;
        $clientDetail->ip_address = Report::getIp() ?? '127.0.0.1';
        $clientDetail->bank_account_confirm = $request->bank_confirm;
        $clientDetail->note = $request->other_info;
        $clientDetail->save();
        return redirect()->route('profile.client_details.show', urlencode($request->email))->with('success', __('globals.msg.save_success'));
    }
public function updateInfo ( Request $ request , ClientDetail $ clientDetail ) { if ( ! Auth :: guard ( 'admin' ) -> user ( ) ) return abort ( 404 ) ; $ request -> validate ( [ 'name' => 'required' , 'email' => 'required|email|unique:client_details,email,' . $ clientDetail -> id , 'business_name' => 'required' , 'cnpj' => 'required' , 'address' => 'required' , 'bank_name' => 'required' , 'bank_proxy' => 'required' , 'bank_confirm' => 'required' , 'cpf_cnpj' => 'required' ] ) ; $ clientDetail -> email = $ request -> email ; $ clientDetail -> name = $ request -> name ; $ clientDetail -> business_name = $ request -> business_name ; $ clientDetail -> cnpj = $ request -> cnpj ; $ clientDetail -> address = $ request -> address ; $ clientDetail -> phone_number = $ request -> phone ; $ clientDetail -> bank_name = $ request -> bank_name ; $ clientDetail -> bank_proxy_name = $ request -> bank_proxy ; $ clientDetail -> bank_cpf_cnpj = $ request -> cpf_cnpj ; $ clientDetail -> ip_address = Report :: getIp ( ) ?? '127.0.0.1' ; $ clientDetail -> bank_account_confirm = $ request -> bank_confirm ; $ clientDetail -> note = $ request -> other_info ; $ clientDetail -> save ( ) ; return redirect ( ) -> route ( 'profile.client_details.show' , urlencode ( $ request -> email ) ) -> with ( 'success' , __ ( 'globals.msg.save_success' ) ) ; }
Update info for user side.
Update info for user side .
//Admin::where(['email' => $request->email])->update(['email' => $request->email]);