iam build two websites using Laravel 5.4 and using Ixudra/Curl libary.
I have 2 virtual host domains in my localhost:
one.dev
two.dev
i have a url in two.dev: http://ift.tt/2o61LzU
/* It have query to get user balance with ID=1 */
User_balance::where('id',Request()->balance)->pluck('balance')->first();
if i accessing that url via browser, it will give success result :
{"Version":"V1","Protocol":"HTTP","Path":"server","Method":"GET","UsingAuth":"false","ErrorStatus":0,"Message":"","Data":{"balance":"4.00"}}
Than in one.dev
, i make a curl request to above url like this below:
$response = Curl::to('http://two.dev/server')
->withData(['balance'=>1])
->get();
return $response;
and the result is error like below:
PDOException in Connection.php line 319:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'where clause'
QueryException in Connection.php line 647:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'where clause' (SQL: select `balance` from `user_balances` where `id` = 1 limit 1)
As if the laravel-query in the function-controller in two.dev is not working. Can someone help me to resolve this?
Thank you so much.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire