I've got a problem with all my queries with a varchar
ID returning an integer.
For example,a query which should return C-1451963448-MjL
returns instead 0.
My query:
$transaction = Transaction::with('user')->get();
return response()->json($transaction);
它返回:
[
{
"id": 0,
"user_id": 8,
"amount": "56164.00",
"created_at": "2016-01-05 10:10:48",
"user": {
"id": 8,
"facebook_id": null,
"first_name": "Alta",
"last_name": "Keebler",
}
},
]
the transaction id becoming 0. Last time I tried it succeeded, but now every ID with varchar
returns 0 instead of the real value.
我try 了foreach
次获取查询,是的,id是0
.
我应该怎么做才能让它再次工作呢?