Home > Mobile >  Laravel seeding date and foreign key
Laravel seeding date and foreign key

Time:05-20

I have some struggles to seed foreign key at this table:

enter image description here

with this factory:

enter image description here

and this seeder:

enter image description here

I usually get this error:

enter image description here

I have tried to comment those fields at the table and just to make some posts without them and then I get the same error just for the field 'updated_at'.

Any ideas on how to solve this? :D

Thanks!

CodePudding user response:

Set asText for paragraphs and words to true:

$this->faker->paragraphs(3, true)

These are methods' signatures:

@method array|string words($nb = 3, $asText = false)
@method array|string paragraphs($nb = 3, $asText = false)
  • Related