I have the following code:
$data['daily_missions'] = DailyMission::with(['userProgress' => function($q) use ($user){
$q->where('user_id',$user->id);
}])
->orderBy('diamonds')
->where('is_daily',1)
->get();
In the DB, most of the fields of the DailyMission / userProgress models are integers - but the API return them as string.
for example:
{
price: "123"
}
instead of:
{
price: 123
}
Any idea what can cause this issue?
Version:
"laravel/framework": "5.2.*",
int? laravel.com/docs/5.2/eloquent-mutators#attribute-casting