Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no good way to set custom model fillers #169

Open
jfadich opened this issue Jul 13, 2018 · 0 comments
Open

There is no good way to set custom model fillers #169

jfadich opened this issue Jul 13, 2018 · 0 comments

Comments

@jfadich
Copy link

jfadich commented Jul 13, 2018

In a project I'm working on I want to use a custom filler. There is a setModelFiller method on the search builder to apply custom fillers, but there is no good way to call it since using the search() method always returns a new instance of the builder. There is also not a config option to set a custom filler.

You can't do this because setModelFiller is not fluent.

Model::search()->setModelFiller(...)->match(...)

You also can't do this because using the search() method always returns a new instance of the builder.

Model::search()->setModelFiller(...);
Model::search()->match(...);

I created pull request #168 to enable the first example.

Current workaround it to store a builder variable:

$search = Model::search();
$search->setModelFiller(...);
$search->match(...);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant