F
Filamentβ€’8mo ago
Quin.

AssociateAction not working on my id

Ello! I have an error and i know what it means, it needs the projects_id but it is called project_id and i like to keep it that way because it is 1 project and not multiple so it doesn't make sense if you would change the name. so can i set it on project_id and not projects_id Relation Manager:
class DomainRelationManager extends RelationManager
{
protected static string $relationship = 'domain';
protected static ?string $recordTitleAttribute = 'domainname';

public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('domainname')
->required()
->maxLength(255),
]);
}

public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('domainname')
->searchable()
->label('Domain')
->translateLabel(),
Tables\Columns\IconColumn::make('sedo')
->boolean()
->label('In Sedo?')
->translateLabel(),
Tables\Columns\TextColumn::make('price_in_cents')
->money('eur')
->label('Price')
->translateLabel(),
])
->filters([
//
])
->headerActions([
Tables\Actions\AssociateAction::make()->preloadRecordSelect(),
])
->actions([
Tables\Actions\DissociateAction::make(),
])
->bulkActions([
//
]);
}
}
class DomainRelationManager extends RelationManager
{
protected static string $relationship = 'domain';
protected static ?string $recordTitleAttribute = 'domainname';

public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('domainname')
->required()
->maxLength(255),
]);
}

public static function table(Table $table): Table
{
return $table
->columns([
Tables\Columns\TextColumn::make('domainname')
->searchable()
->label('Domain')
->translateLabel(),
Tables\Columns\IconColumn::make('sedo')
->boolean()
->label('In Sedo?')
->translateLabel(),
Tables\Columns\TextColumn::make('price_in_cents')
->money('eur')
->label('Price')
->translateLabel(),
])
->filters([
//
])
->headerActions([
Tables\Actions\AssociateAction::make()->preloadRecordSelect(),
])
->actions([
Tables\Actions\DissociateAction::make(),
])
->bulkActions([
//
]);
}
}
No description
2 Replies
Quin.
Quin.β€’8mo ago
fixed , you can give specific key to your model πŸ™‚
Quin.
Quin.β€’8mo ago
No description