In my project I'm trying to take data from a 3rd party api and add that data into my database. The column names will save into columns in my database that do have different name (for instance access_tokem would be saved as token column in my database)
I know how to make a url request in curl but I dont know how to consume the data into my database. (im open to other options)
my function
public function addPlaid(Request $request) // adds a plaid user
{
$username = $request->input('bank_username');
$password = $request->input('bank_password');
$pin = $request->input('pin'); // set null
$type = $request->input('type');
// $authUser = Plaid::addAuthUser('plaid_test', 'plaid_good', null, 'chase');
$authUser = Plaid::addAuthUser($username, $password, $pin, $type);
return $authUser;
}
json response
{
"type": "device",
"mfa": {
"message": "Code sent to [email protected]"
},
"access_token": "test_chase"
}
I wanna save "type" and "access_token".
type will be saved in table:user column:type
and access_token in table: user_auth column: token