Select::make('entity_type_id') ->label('Entity Type') ->relationship('entityType', 'name') ->required(),TextInput::make('name') ->required() ->unique('entities', 'name') ->validationMessages([ 'unique' => 'This {{I want to display entityType.name here}} already has an attribute with this name.', ]) ->maxLength(255),
<?phpnamespace App\Filament\Resources\EntityTypeResource\Pages;use App\Filament\Resources\EntityTypeResource;use App\Models\EntityType;use Filament\Actions\EditAction;use Filament\Resources\Pages\ViewRecord;class ViewEntityType extends ViewRecord{ protected static string $resource = EntityTypeResource::class; protected function getHeaderActions(): array { return [ EditAction::make() ->slideOver() ->form(EntityType::getForm()), ]; }}
it('renders the edit slideover', function () { $entityType = EntityType::factory()->create(); livewire(ViewEntityType::class, ['record' => $entityType->getRouteKey()]) ->mountAction(['edit']) ->callAction(['edit']) ->assertSee('Save changes');});