xfly
Adding HasMany to Form Tabs or HasOne to the Top Tabs
Hi,
i want to add either the hasMany relations to the form tabs like the hasOne Relations:
Forms\Components\Tabs\Tab::make('Prozess')
->columns('2')
->schema([
Forms\Components\TextInput::make('name'),
Forms\Components\TextInput::make('email'),
]),
or the HasOne to the Tabs on the top when adding:
public function hasCombinedRelationManagerTabsWithContent(): bool
{
return true;
}
to the edit page.
it's just better ux for the user in my opinion. is this possible?
thank you in advance.
2 replies
One widget for each entry + edit link
Hi, is it possible to generate a widget for each, in my example 'process', which is showing also a button to go to the edit page of the 'process'?
currently i make it with a custom page but i was wondering if it's possible on the dashboard too.
thanks in advance.
2 replies
Old value in relationship manager
hi,
how can i get the old value of a TextInput in a Rule?
Forms\Components\TextInput::make('portion')
->rule('lte:' . 100 - $this->getOwnerRecord()->process_shareholders_portion - OLDVALUE)
->numeric()
->live()
->required(),
i tried many ways but i can't get it work. the sum of the portions always needs to be max 100 but needs to check the portions of other shareholders. i get the process_shareholders_portion from the process model casted.
thank you in advance.
4 replies
Get relationship in select
a user hasOne profile, how can i show the user.profile.first_name and user.profile.last_name instead of the 'name' of the users table?
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\Select::make('status')
->options(ProcessStatus::class),
Forms\Components\Select::make('user_id')
->label('User')
->options(User::all()->pluck('name', 'id'))
]);
}
4 replies