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

Limiter on input maker models #2

Closed
absalomedia opened this issue Jul 27, 2016 · 4 comments
Closed

Limiter on input maker models #2

absalomedia opened this issue Jul 27, 2016 · 4 comments

Comments

@absalomedia
Copy link

Currently Laracogs eager loads the model of whatever relationship it's presented with. i.e.

@input_maker_label('Store')
@input_maker_create('stores', ['type' => 'relationship', 'model' => 'App\Repositories\Store\Store', 'label' => 'name', 'value' => 'id'], $user)

I'm looking for a way to limit what's loaded into the model somehow. Any ideas on how to go about this?

@mlantz
Copy link
Member

mlantz commented Jul 27, 2016

When you say limit do you mean you'd like to be able to have a set of logic which limits the return of values? For example based on permission?

@absalomedia
Copy link
Author

absalomedia commented Jul 27, 2016

I need some way of passing in equivalent of:
Class::where('var','=',1)->get();
into input_maker_create for relationships instead of eager loading the entire model.

@mlantz
Copy link
Member

mlantz commented Jul 28, 2016

Ok, I've added that in, will release sometime today :)

@mlantz mlantz closed this as completed Jul 28, 2016
@absalomedia
Copy link
Author

Works as planned. Thanks for this

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

2 participants