- App Version: 2.1.0
- PHP Version: 8.4
- Database Driver & Version: MySQL 8.0
Steps To Reproduce
When trying to use the Filter object like so:
public function index(PostFilter $postFilter)
{
$posts = Post::with(['media'])->filter($postFilter)->get();
//
}
The relevant filter methods are not called, presumably because the Request object passed to PostFilter when it is created, is empty.
If I instead do the following:
public function index()
{
$postFilter = new PostFilter(request());
$posts = Post::with(['media'])->filter($postFilter)->get();
//
}
This consistently functions as expected. It seems the problem is the DI container not instantiating the PostFilter object correctly.
It should not be caused by caching, as caching was disabled wherever possible for all of my testing.
Steps To Reproduce
When trying to use the Filter object like so:
The relevant filter methods are not called, presumably because the
Requestobject passed to PostFilter when it is created, is empty.If I instead do the following:
This consistently functions as expected. It seems the problem is the DI container not instantiating the
PostFilterobject correctly.It should not be caused by caching, as caching was disabled wherever possible for all of my testing.