F
Filament3mo ago
MZX

Form not submitting user_id even though when I dd the submission the user_id is present

This is my form
return $form
->schema([
Forms\Components\Select::make('user_id')
->relationship('user', 'name')
->required(),
Forms\Components\TextInput::make('rank')
->required(),
Forms\Components\TextInput::make('no_of_research')
->required()
->numeric(),
]);
return $form
->schema([
Forms\Components\Select::make('user_id')
->relationship('user', 'name')
->required(),
Forms\Components\TextInput::make('rank')
->required(),
Forms\Components\TextInput::make('no_of_research')
->required()
->numeric(),
]);
2 Replies
MZX
MZXOP3mo ago
and this is the dd result
array:3 [// app\Filament\Resources\ResearcherResource\Pages\CreateResearcher.php:15
"user_id" => "18"
"rank" => "Assistant Professor"
"no_of_research" => "45"
]
array:3 [// app\Filament\Resources\ResearcherResource\Pages\CreateResearcher.php:15
"user_id" => "18"
"rank" => "Assistant Professor"
"no_of_research" => "45"
]
The relationships have been defined This is the error i face SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: researchers.user_id (Connection: sqlite, SQL: insert into "researchers" ("rank", "no_of_research", "updated_at", "created_at") values (Assistant Professor, 45, 2024-10-14 21:59:43, 2024-10-14 21:59:43)) I fixed it by making the column nullable, and it does populate the value, but i would still like to know why it wasn't working
Vp
Vp3mo ago
fillable ?
Want results from more Discord servers?
Add your server