55use App \Filament \Admin \Resources \ComputerScienceResource \Pages ;
66use App \Filament \Admin \Resources \UserResource \RelationManagers \UserRelationManager ;
77use App \Models \ComputerScienceResource as ModelsComputerScienceResource ;
8+ use Filament \Forms ;
9+ use Filament \Forms \Form ;
810use Filament \Resources \Resource ;
911use Filament \Tables ;
1012use Filament \Tables \Actions \BulkAction ;
@@ -27,6 +29,51 @@ public static function getEloquentQuery(): Builder
2729
2830 protected static ?string $ navigationIcon = 'heroicon-o-rectangle-stack ' ;
2931
32+ public static function form (Form $ form ): Form
33+ {
34+ return $ form
35+ ->schema ([
36+ Forms \Components \TextInput::make ('name ' )
37+ ->required ()
38+ ->maxLength (255 ),
39+
40+ Forms \Components \Textarea::make ('description ' )
41+ ->maxLength (65535 )
42+ ->columnSpanFull (),
43+
44+ Forms \Components \TextInput::make ('slug ' )
45+ ->maxLength (255 ),
46+
47+ Forms \Components \Select::make ('user_id ' )
48+ ->relationship ('user ' , 'name ' )
49+ ->required (),
50+
51+ Forms \Components \TagsInput::make ('topic_tags ' )
52+ ->label ('Topic Tags ' )
53+ ->disabled ()
54+ ->helperText ('These are computed from relationships ' ),
55+
56+ Forms \Components \TagsInput::make ('programming_language_tags ' )
57+ ->label ('Programming Language Tags ' )
58+ ->disabled ()
59+ ->helperText ('These are computed from relationships ' ),
60+
61+ Forms \Components \TagsInput::make ('general_tags ' )
62+ ->label ('General Tags ' )
63+ ->disabled ()
64+ ->helperText ('These are computed from relationships ' ),
65+
66+ // Editable date fields
67+ Forms \Components \DateTimePicker::make ('created_at ' )
68+ ->label ('Created Date ' )
69+ ->seconds (false ),
70+
71+ Forms \Components \DateTimePicker::make ('updated_at ' )
72+ ->label ('Updated Date ' )
73+ ->seconds (false ),
74+ ]);
75+ }
76+
3077 public static function table (Table $ table ): Table
3178 {
3279 return $ table
0 commit comments