<?php

namespace App\Http\Controllers\api;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use DB;
class AddressController extends Controller
{
    public function getAddress($tokenId){
        $authTokenID = DB::table('personal_access_tokens')->where(['id'=>$tokenId])->first();
        $userId = DB::table('users')->where(['id'=>$authTokenID->tokenable_id])->first();
        $paymentMethods = DB::table('payment_methods')->get();
        return response()->json([
            'user'=>$userId,
            'paymentMethods'=>$paymentMethods,
        ]);
    }
}
