schema([ Forms\Components\Select::make('drug_id') ->required() ->relationship('drug', 'brand_name') ->getOptionLabelFromRecordUsing(fn ($record) => "{$record->brand_name} ({$record->generic})") ->searchable(['brand_name', 'generic']), Forms\Components\DatePicker::make('start_date') ->required(), Forms\Components\DatePicker::make('end_date'), Forms\Components\Textarea::make('instructions') ->columnSpanFull(), Forms\Components\Hidden::make('appointment_id') ->default(fn ($livewire) => $livewire->ownerRecord->id), ]); } public function table(Table $table): Table { return $table ->recordTitleAttribute('medication.name') ->columns([ Tables\Columns\TextColumn::make('drug.brand_name'), Tables\Columns\TextColumn::make('start_date'), ]) ->filters([ // ]) ->headerActions([ Tables\Actions\CreateAction::make() ->label('New Prescription') ->modalHeading('Create Prescription'), ]) ->actions([ Tables\Actions\EditAction::make(), Tables\Actions\DeleteAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]); // >emptyStateHeading('No Prescriptions yet')->emptyStateDescription('Create a Prescriptions to get started.'); } public function isReadOnly(): bool { return false; } }