Skip to content

Commit 830bb38

Browse files
committed
add collection id
1 parent 1bb2f71 commit 830bb38

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

app/Models/Event.php

+12-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Carbon\Carbon;
77
use Filament\Forms\Components\DateTimePicker;
88
use Filament\Forms\Components\Section;
9+
use Filament\Forms\Components\Select;
910
use Filament\Forms\Components\TextInput;
1011
use Illuminate\Database\Eloquent\Factories\HasFactory;
1112
use Illuminate\Database\Eloquent\Model;
@@ -38,6 +39,11 @@ public static function getForm(): array
3839
->columns(1)
3940
->schema([
4041
TextInput::make('title')->required(),
42+
Select::make('collection_id')
43+
->searchable()
44+
->preload()
45+
->relationship(name: 'collection', titleAttribute: 'name')
46+
->label('Collection'),
4147
TextInput::make('description')->required(),
4248
TextInput::make('location'),
4349
]),
@@ -46,8 +52,12 @@ public static function getForm(): array
4652

4753
->columns(2)
4854
->schema([
49-
DateTimePicker::make('start_date')->required(),
50-
DateTimePicker::make('end_date')->required(),
55+
DateTimePicker::make('start_date')
56+
->native(false)
57+
->required(),
58+
DateTimePicker::make('end_date')
59+
->native(false)
60+
->required(),
5161
]),
5262
];
5363
}

tests/fixtures/.DS_Store

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)