Custom UUID models not working on save

Missing required parameter for [Route: filament.admin.resources.tours.edit] [URI: admin/tours/{record}/edit] [Missing parameter: record]. Getting this error for any model I have with uuids. The IDs are generated by the DB tho so that might be it?
7 Replies
Dan Harrin
Dan Harrin4w ago
What is the uuid column name
Никола Стојков
id keep in mind I do have
public $incrementing = false;
protected $keyType = 'string';
public $incrementing = false;
protected $keyType = 'string';
in the models
Dan Harrin
Dan Harrin4w ago
if you query the table with eloquent are the id attributes filled when the models are returned
Никола Стојков
yeye tables are working fine and viewing/editing the record id field is not in fillable also
Dan Harrin
Dan Harrin4w ago
not sure, uuids work fine in my projects.
Vp
Vp4w ago
Just checked and everything is working fine. What I need to change for uuid 1. $table->uuid('id')->primary() 2. use HasUuids trait in model (optional) 3. $table->foreignUuid('column') By following only 1 & 2, it's working as expected. Note that I don't put public $incrementing = false; & protected $keyType = 'string'; in my model but maybe better to include
Никола Стојков
Okay, turns out I have to sleep more often I somehow missed the HasUuids trait

Did you find this page helpful?