F
Filament5mo ago
kisut

Not saving all the input

I created a form, but why aren't all inputs saved? My model
protected $fillable = [
'user_id',
'track_title',
'track_primary_artist',
'track_featuring_artist',
'genre_track',
'preview_track',
'isrc_track',
'language_track',
'explicit_track',
'writer_track',
];
protected $fillable = [
'user_id',
'track_title',
'track_primary_artist',
'track_featuring_artist',
'genre_track',
'preview_track',
'isrc_track',
'language_track',
'explicit_track',
'writer_track',
];
Error message
SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "track_primary_artist" of relation "tracks" violates not-null constraint DETAIL: Failing row contains (16, 1, null, Surga & Neraka, null, null, Hip-Hop/Rap, 11:24, null, ID, null, ["Hildan Ramdani"], 2024-06-28 03:43:38, 2024-06-28 03:43:38). (Connection: pgsql, SQL: insert into "tracks" ("track_title", "genre_track", "preview_track", "isrc_track", "language_track", "writer_track", "user_id", "updated_at", "created_at") values (Surga & Neraka, Hip-Hop/Rap, 11:24, ?, ID, ["Hildan Ramdani"], 1, 2024-06-28 03:43:38, 2024-06-28 03:43:38) returning "id")
SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "track_primary_artist" of relation "tracks" violates not-null constraint DETAIL: Failing row contains (16, 1, null, Surga & Neraka, null, null, Hip-Hop/Rap, 11:24, null, ID, null, ["Hildan Ramdani"], 2024-06-28 03:43:38, 2024-06-28 03:43:38). (Connection: pgsql, SQL: insert into "tracks" ("track_title", "genre_track", "preview_track", "isrc_track", "language_track", "writer_track", "user_id", "updated_at", "created_at") values (Surga & Neraka, Hip-Hop/Rap, 11:24, ?, ID, ["Hildan Ramdani"], 1, 2024-06-28 03:43:38, 2024-06-28 03:43:38) returning "id")
Is there anyone who can help me?
1 Reply
Kymset
Kymset5mo ago
Can you post the code of your form? Also what kind of value should track_primary_artist be? I assume boolean?
Want results from more Discord servers?
Add your server