2

How to get the same model id i tried this not working.

$factory->define(App\Item::class, function (Faker\Generator $faker) {
    return [
        'name' => $faker->name,
        'color' => $faker->color_name,
        'position' => App\Item::all()->get('id'),
    ];
});

I want to get the same id for the item so that the item position is the same when the application runs and can be edited to something (integer only).

Douglass
  • 49
  • 4

0 Answers0