public function postCoupon(BillingRequest $request)
    {
        try {
            $payload = $request->all();
            auth()->user()->meta->applyCoupon($payload['coupon']);
            return redirect('user/billing/details')->with('message', 'Your coupon was used!');
        } catch (Exception $e) {
            Log::error($e->getMessage());
            return back()->withErrors(['Could not process the coupon please try again.']);
        }

        return back()->withErrors(['Could not add your coupon, please try again.']);
    }
public function postCoupon(BillingRequest $request)
    {
        try {
            $payload = $request->all();
            auth()->user()->meta->applyCoupon($payload['coupon']);
            return redirect('user/billing/details')->with('message', 'Your coupon was used!');
        } catch (Exception $e) {
            Log::error($e->getMessage());
            return back()->withErrors(['Could not process the coupon please try again.']);
        }

        return back()->withErrors(['Could not add your coupon, please try again.']);
    }
public function postCoupon ( BillingRequest $ request ) { try { $ payload = $ request -> all ( ) ; auth ( ) -> user ( ) -> meta -> applyCoupon ( $ payload [ 'coupon' ] ) ; return redirect ( 'user/billing/details' ) -> with ( 'message' , 'Your coupon was used!' ) ; } catch ( Exception $ e ) { Log :: error ( $ e -> getMessage ( ) ) ; return back ( ) -> withErrors ( [ 'Could not process the coupon please try again.' ] ) ; } return back ( ) -> withErrors ( [ 'Could not add your coupon, please try again.' ] ) ; }
Use a coupon

@param  Request $request
@return \Illuminate\Http\Response
Use a coupon