public function postChangeCard(BillingRequest $request)
    {
        try {
            $payload = $request->all();
            $creditCardToken = $payload['stripeToken'];
            auth()->user()->meta->updateCard($creditCardToken);
            return redirect('user/billing/details')->with('message', 'Your subscription has been updated!');
        } catch (Exception $e) {
            Log::error($e->getMessage());
            return back()->withErrors(['Could not process the billing please try again.']);
        }

        return back()->withErrors(['Could not complete billing, please try again.']);
    }
public function postChangeCard(BillingRequest $request)
    {
        try {
            $payload = $request->all();
            $creditCardToken = $payload['stripeToken'];
            auth()->user()->meta->updateCard($creditCardToken);
            return redirect('user/billing/details')->with('message', 'Your subscription has been updated!');
        } catch (Exception $e) {
            Log::error($e->getMessage());
            return back()->withErrors(['Could not process the billing please try again.']);
        }

        return back()->withErrors(['Could not complete billing, please try again.']);
    }
public function postChangeCard ( BillingRequest $ request ) { try { $ payload = $ request -> all ( ) ; $ creditCardToken = $ payload [ 'stripeToken' ] ; auth ( ) -> user ( ) -> meta -> updateCard ( $ creditCardToken ) ; return redirect ( 'user/billing/details' ) -> with ( 'message' , 'Your subscription has been updated!' ) ; } catch ( Exception $ e ) { Log :: error ( $ e -> getMessage ( ) ) ; return back ( ) -> withErrors ( [ 'Could not process the billing please try again.' ] ) ; } return back ( ) -> withErrors ( [ 'Could not complete billing, please try again.' ] ) ; }
Save new credit card

@param  Request $request
@return \Illuminate\Http\Response
Save new credit card