sistemasjg
How to get Model property from recordSelectOptionsQuery
Hi there, greetings from Isla de Margarita, Venezuela, first question here.
I'm using RelationManager in multiple Resources, so, depending of Resource/Model I need to filter recordSelectOptionsQuery for an Attach Action, something like :
RelationManager:
->recordSelectOptionsQuery(
function (Builder $query)
{
$allowedTypes = $ownerRecord->allowedRelatedAttachTypes <---------------------
return $query->whereIn('trading_partners.type_id', $allowedTypes );
}
)
Model:
class _TradingPartner extends Model
{
...
protected static $allowedRelatedAttachTypes = ['P', 'A'];
...
}
But I'm unable to get something on this stage, thanks in advance for your help2 replies