Đóng gói cuối tuần

This commit is contained in:
2026-04-18 04:46:01 +00:00
parent 761b34916b
commit 3cef1c40df
37 changed files with 1266 additions and 301 deletions

View File

@@ -11,12 +11,17 @@ use Filament\Schemas\Schema;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use App\Enums\NavigationGroup;
class ProjectResource extends Resource
{
protected static ?string $model = Project::class;
protected static string | \BackedEnum | null $navigationIcon = 'heroicon-o-building-office-2';
protected static string | \UnitEnum | null $navigationGroup = 'Quản lý Dự án';
protected static string | \UnitEnum | null $navigationGroup = NavigationGroup::PROJECT->value;
protected static ?int $navigationSort = 1;
protected static ?string $modelLabel = 'Dự án';
protected static ?string $pluralModelLabel = 'Dự án';
public static function form(Schema $schema): Schema
{
@@ -25,9 +30,16 @@ class ProjectResource extends Resource
Section::make('Thông tin Dự án')
->columns(2)
->schema([
TextInput::make('name')->label('Tên Dự án')->required()->maxLength(255),
Select::make('type')->label('Loại hình')->options(['Khu đô thị' => 'Khu đô thị', 'Chung cư' => 'Chung cư', 'Đất nền phân lô' => 'Đất nền phân lô', 'Khu nghỉ dưỡng' => 'Khu nghỉ dưỡng'])->required(),
TextInput::make('address')->label('Địa chỉ chi tiết')->columnSpanFull(),
TextInput::make('code')->label(' Dự án')->required()->unique(ignoreRecord: true),
TextInput::make('name')->label('Tên Dự án')->required(),
Select::make('type')
->label('Loại hình')
->options([
'Khu đô thị' => 'Khu đô thị',
'Chung cư' => 'Chung cư',
'Đất nền phân lô' => 'Đất nền phân lô',
])->required(),
TextInput::make('address')->label('Địa chỉ')->columnSpanFull(),
])
]);
}
@@ -36,12 +48,10 @@ class ProjectResource extends Resource
{
return $table
->columns([
Tables\Columns\TextColumn::make('name')->label('Tên Dự án')->searchable()->sortable(),
Tables\Columns\TextColumn::make('type')->label('Loại hình')->badge()->sortable(),
Tables\Columns\TextColumn::make('address')->label('Địa chỉ')->limit(50),
Tables\Columns\TextColumn::make('created_at')->label('Ngày tạo')->dateTime('d/m/Y')->sortable()->toggleable(isToggledHiddenByDefault: true),
])
->defaultSort('created_at', 'desc');
Tables\Columns\TextColumn::make('code')->label('Mã')->sortable(),
Tables\Columns\TextColumn::make('name')->label('Tên Dự án')->searchable(),
Tables\Columns\TextColumn::make('type')->label('Loại hình')->badge(),
]);
}
public static function getPages(): array