Skip to content

Commit

Permalink
Merge pull request #10417 from inietov/fixes/trying_to_get_property_i…
Browse files Browse the repository at this point in the history
…d_of_nonobject

Fixes trying to get property 'id' of non-object when running develop seeders.
  • Loading branch information
snipe authored Mar 2, 2022
2 parents dc1e0ec + 2b4ee48 commit 16fd109
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions database/factories/AssetFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use App\Models\Location;
use App\Models\Supplier;
use Illuminate\Database\Eloquent\Factories\Factory;
use App\Models\StatusLabel;

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -39,15 +38,16 @@ public function definition()
{
return [
'name' => null,
'rtd_location_id' => Location::factory()->create(),
'rtd_location_id' => Location::all()->random()->id,
'serial' => $this->faker->uuid,
'status_id' => $this->faker->numberBetween(1,5),
'status_id' => 1,
'user_id' => 1,
'asset_tag' => $this->faker->unixTime('now'),
'notes' => 'Created by DB seeder',
'purchase_date' => $this->faker->dateTimeBetween('-1 years', 'now', date_default_timezone_get()),
'purchase_cost' => $this->faker->randomFloat(2, '299.99', '2999.99'),
'order_number' => $this->faker->numberBetween(1000000, 50000000),
'supplier_id' => Supplier::all()->random()->id,
'requestable' => $this->faker->boolean(),
'assigned_to' => null,
'assigned_type' => null,
Expand Down

0 comments on commit 16fd109

Please sign in to comment.