schema([ Split::make([ Section::make([ Select::make('customer_id') ->label('Customer') ->options(Customer::all()->pluck('company_name', 'id')) ->searchable(), Select::make('contact_id') ->label('Contact'), ]), ]), Split::make([ Section::Make([ Select::make('order_type') ->options(OrderType::class) ->searchable(), Select::make('order_status') ->options(OrderStatus::class) ->searchable(), ]), ]), Section::Make([ TextInput::make('customer_po'), ]), Section::make([ DatePicker::make('order_date'), DatePicker::make('due_date'), ])->columns(2), Section::make([ CheckboxList::make('Attributes') ->options([ 'new_art' => 'New Art', 'repeat' => 'Repeat', 'rush' => 'Rush', 'event' => 'Event', 'digitizing' => 'Digitizing', 'purchased_garments' => 'Purchased Garments', 'customer_supplied_file' => 'Customer Supplied File', ]) ->columns(2), ]), Textarea::make('note'), ]); } public static function table(Table $table): Table { return $table // ->recordClasses(fn (Order $order) => match ($order->rush) { // 1 => 'border-8 bg-black border-orange-600 dark:border-orange-300', // 0 => 'border-2 border-orange-600 dark:border-orange-300', // default => null, // }) ->columns([ TextColumn::make('internal_po') ->label('Internal PO') ->copyable() ->fontFamily('mono') ->color('info') ->searchable() ->sortable(), TextColumn::make('customer.company_name') ->searchable() ->sortable(), TextColumn::make('customer_po') ->label('PO') ->wrap() ->copyable() ->weight('bold') ->color('code') ->searchable() ->sortable(), TextColumn::make('order_date') ->searchable() ->sortable(), TextColumn::make('due_date') ->searchable() ->sortable(), TextColumn::make('status') ->badge() ->searchable() ->sortable(), TextColumn::make('rush') ->searchable() ->sortable(), ]) ->filters([ Tables\Filters\SelectFilter::make('status') ->multiple() ->options(OrderStatus::class), ]) ->actions([ Tables\Actions\EditAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DeleteBulkAction::make(), ]), ]); } public static function getRelations(): array { return [ // ]; } public static function getPages(): array { return [ 'index' => Pages\ListOrders::route('/'), 'create' => Pages\CreateOrder::route('/create'), 'edit' => Pages\EditOrder::route('/{record}/edit'), ]; } }