ilirien
ilirien
@timacdonald As I understood, we can only call one scope for all types in whereHasPolymorphic, but we can do something like that: `hasPolymorphic('eventable', [Post::class => function($query) {}, Video::class => function($query)...
And just my opinion, better to call it hasMorph, everywhere in laravel it calls like that. So I think it will be good to follow.
@staudenmeir about different constraints. Yes your example will work, but you will need to wrap it into one group almost always. It's just suggestion how to improve and decrease code...
@staudenmeir ``` Event::whereHasPolymorphic( 'eventable', [ Post::class => function($query) { // }, Video::class => function ($query) { // } ] );
@staudenmeir In my variant I don't have third parameter as constrain for all types, but it will be great idea. :) You can pass it and just apply this scope,...
@staudenmeir I like it, good idea