Kimi chinh sua

This commit is contained in:
2026-04-24 08:58:53 +00:00
parent 91ff4a5e4d
commit 86216ef872
43 changed files with 2868 additions and 597 deletions

View File

@@ -4,14 +4,12 @@ namespace App\Filament\Resources\Projects;
use App\Filament\Resources\Projects\Pages;
use App\Models\Project;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Select;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use App\Enums\NavigationGroup;
use App\Filament\Resources\Projects\Schemas\ProjectForm;
class ProjectResource extends Resource
{
@@ -25,28 +23,7 @@ class ProjectResource extends Resource
public static function form(Schema $schema): Schema
{
return $schema
->components([
Section::make('Thông tin Dự án')
->columns(2)
->schema([
TextInput::make('code')->label('Mã Dự án')->required()->unique(ignoreRecord: true),
TextInput::make('name')->label('Tên Dự án')->required(),
Select::make('payment_template_id')
->label('Mẫu thanh toán mặc định')
->relationship('paymentTemplate', 'name')
->placeholder('Chọn mẫu thanh toán cho toàn dự án')
->columnSpanFull(),
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(),
])
]);
return ProjectForm::configure($schema);
}
public static function table(Table $table): Table

View File

@@ -2,6 +2,9 @@
namespace App\Filament\Resources\Projects\Schemas;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;
class ProjectForm
@@ -10,7 +13,25 @@ class ProjectForm
{
return $schema
->components([
//
Section::make('Thông tin Dự án')
->columns(2)
->schema([
TextInput::make('code')->label('Mã Dự án')->required()->unique(ignoreRecord: true),
TextInput::make('name')->label('Tên Dự án')->required(),
Select::make('payment_template_id')
->label('Mẫu thanh toán mặc định')
->relationship('paymentTemplate', 'name')
->placeholder('Chọn mẫu thanh toán cho toàn dự án')
->columnSpanFull(),
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(),
])
]);
}
}