value; protected static ?int $navigationSort = 2; protected static ?string $modelLabel = 'Sản phẩm'; protected static ?string $pluralModelLabel = 'Sản phẩm'; public static function form(Schema $schema): Schema { return $schema ->components([ Tabs::make('ProductDetails') ->tabs([ Tabs\Tab::make('Thông tin chung') ->icon('heroicon-o-information-circle') ->columns(2) ->schema([ Select::make('project_id')->label('Dự án')->relationship('project', 'name')->required(), Select::make('product_type')->label('Loại sản phẩm')->options(ProductType::class)->required(), TextInput::make('code')->label('Mã SP')->required()->unique(ignoreRecord: true), Select::make('status') ->label('Trạng thái') ->options(['Đang mở bán' => 'Đang mở bán', 'Đã cọc' => 'Đã cọc', 'Đã bán' => 'Đã bán']) ->required(), ]), Tabs\Tab::make('Tài chính') ->icon('heroicon-o-currency-dollar') ->schema([ TextInput::make('area')->label('Diện tích (m2)')->numeric()->required(), TextInput::make('price_per_unit')->label('Đơn giá')->numeric()->required(), TextInput::make('total_price')->label('Tổng giá')->numeric()->required(), ]), ])->columnSpanFull() ]); } public static function table(Table $table): Table { return $table ->columns([ Tables\Columns\TextColumn::make('project.code')->label('Dự án'), Tables\Columns\TextColumn::make('code')->label('Mã SP')->searchable(), Tables\Columns\TextColumn::make('product_type')->label('Loại')->badge(), Tables\Columns\TextColumn::make('total_price')->label('Giá')->money('VND'), Tables\Columns\TextColumn::make('status')->label('Trạng thái')->badge(), ]); } public static function getRelations(): array { return [ContractsRelationManager::class]; } public static function getPages(): array { return [ 'index' => Pages\ListProducts::route('/'), 'create' => Pages\CreateProduct::route('/create'), 'edit' => Pages\EditProduct::route('/{record}/edit'), ]; } }