platform
platform copied to clipboard
Closures for fromModel
Hi, consider this:
Relation::make('account')->fromModel(Account::class, 'first_name')->title('Account'),
I would like to do something like this:
Relation::make('account')->fromModel(Account::class, fn ($model) => $model->first_name . ' ' . $model->last_name)->title('Account'),
Or this:
Relation::make('account')->fromModel(Account::class, fn ($model) => $model->getFullName())->title('Account'),
I do not want to use model attributes.