Tracker::logByRouteName returns 0 for multiple parameters
rodinmehr opened this issue · 0 comments
rodinmehr commented
I have a route with multiple parameters. Let's say something like this:
Route::get('user/{id}/image/{image_id}', ['as' => 'user.profile', 'use' => 'UsersController@profile']);
When I want to use Tracker::logByRouteName with multiple parameters, I get zero.
I have tested these four ways and all of them come with the same result:
1)
Tracker::logByRouteName('user.profile')
->where(function($query)
{
$query
->where('parameter', ['id', 'image_id'])
->where('value', [1, 1]);
})
->count();
Tracker::logByRouteName('user.profile')
->where(function($query)
{
$query
->where('parameter', 'id')
->where('value', 1)
->where('parameter', 'image_id')
->where('value', 1);
})
->count();
Tracker::logByRouteName('user.profile')
->where(function($query)
{
$query
->where('parameter', 'id')
->where('value', 1);
})
->where(function($query)
{
$query
->where('parameter', 'image_id')
->where('value', 1);
})
->count();
Tracker::logByRouteName('user.profile')
->where(function($query)
{
$query
->where('parameter', 'id')
->where('value', 1);
$query
->where('parameter', 'image_id')
->where('value', 1);
})
->count();
If I use just one of the parameters (id or image_id, it works fine; It doesn't return the right answer though.
How can I fix this problem?