2016-03-25 01:18:05 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Model Factories
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Here you may define all of your model factories. Model factories give
|
|
|
|
| you a convenient way to create models for testing and seeding your
|
|
|
|
| database. Just tell the factory how a default model should look.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2017-01-22 14:57:09 -08:00
|
|
|
use App\Models\AssetModel;
|
2017-01-18 16:50:33 -08:00
|
|
|
use App\Models\Category;
|
2016-11-20 19:59:57 -08:00
|
|
|
use App\Models\Company;
|
|
|
|
use App\Models\Location;
|
|
|
|
use App\Models\Manufacturer;
|
2017-01-22 14:57:09 -08:00
|
|
|
use App\Models\Statuslabel;
|
2016-11-20 19:59:57 -08:00
|
|
|
use App\Models\Supplier;
|
|
|
|
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2017-06-12 17:39:03 -07:00
|
|
|
$factory->define(App\Models\Company::class, function (Faker\Generator $faker) {
|
2016-12-19 11:04:28 -08:00
|
|
|
return [
|
2017-06-12 17:39:03 -07:00
|
|
|
'name' => $faker->company,
|
2016-12-19 11:04:28 -08:00
|
|
|
];
|
2016-03-25 01:18:05 -07:00
|
|
|
});
|
|
|
|
|
2017-06-12 17:39:03 -07:00
|
|
|
$factory->define(App\Models\Component::class, function (Faker\Generator $faker) {
|
2016-11-20 19:59:57 -08:00
|
|
|
return [
|
2017-06-12 17:39:03 -07:00
|
|
|
'name' => $faker->text(20),
|
|
|
|
'category_id' => function () {
|
|
|
|
return factory(App\Models\Category::class)->create()->id;
|
|
|
|
},
|
2017-10-07 02:27:02 -07:00
|
|
|
'location_id' => 1,
|
2017-06-12 17:39:03 -07:00
|
|
|
'serial' => $faker->uuid,
|
|
|
|
'qty' => $faker->numberBetween(3, 10),
|
|
|
|
'order_number' => $faker->numberBetween(1000000, 50000000),
|
|
|
|
'purchase_date' => $faker->dateTime(),
|
|
|
|
'purchase_cost' => $faker->randomFloat(2),
|
|
|
|
'min_amt' => $faker->numberBetween($min = 1, $max = 2),
|
|
|
|
'company_id' => function () {
|
|
|
|
return factory(App\Models\Company::class)->create()->id;
|
|
|
|
},
|
2016-11-20 19:59:57 -08:00
|
|
|
];
|
2016-03-25 01:18:05 -07:00
|
|
|
});
|
|
|
|
|
2017-10-07 02:45:54 -07:00
|
|
|
|
2017-06-12 17:39:03 -07:00
|
|
|
$factory->define(App\Models\Location::class, function (Faker\Generator $faker) {
|
2016-12-19 11:04:28 -08:00
|
|
|
return [
|
2017-10-07 02:27:02 -07:00
|
|
|
'name' => $faker->city,
|
2017-06-12 17:39:03 -07:00
|
|
|
'address' => $faker->streetAddress,
|
|
|
|
'address2' => $faker->secondaryAddress,
|
|
|
|
'city' => $faker->city,
|
|
|
|
'state' => $faker->stateAbbr,
|
|
|
|
'country' => $faker->countryCode,
|
|
|
|
'currency' => $faker->currencyCode,
|
2017-10-28 05:46:43 -07:00
|
|
|
'zip' => $faker->postcode,
|
|
|
|
'image' => rand(1,9).'.jpg',
|
2016-12-19 11:04:28 -08:00
|
|
|
];
|
2016-03-25 01:18:05 -07:00
|
|
|
});
|
|
|
|
|
2016-09-29 22:20:49 -07:00
|
|
|
|
2017-06-12 17:39:03 -07:00
|
|
|
$factory->define(App\Models\Supplier::class, function (Faker\Generator $faker) {
|
2016-12-19 11:04:28 -08:00
|
|
|
return [
|
2017-06-12 17:39:03 -07:00
|
|
|
'name' => $faker->company,
|
|
|
|
'address' => $faker->streetAddress,
|
|
|
|
'address2' => $faker->secondaryAddress,
|
|
|
|
'city' => $faker->city,
|
|
|
|
'state' => $faker->stateAbbr,
|
|
|
|
'zip' => $faker->postCode,
|
|
|
|
'country' => $faker->countryCode,
|
|
|
|
'contact' => $faker->name,
|
|
|
|
'phone' => $faker->phoneNumber,
|
|
|
|
'fax' => $faker->phoneNumber,
|
|
|
|
'email' => $faker->safeEmail,
|
|
|
|
'url' => $faker->url,
|
|
|
|
'notes' => $faker->text(255) // Supplier notes can be a max of 255 characters.
|
2016-12-19 11:04:28 -08:00
|
|
|
];
|
2016-09-29 22:20:49 -07:00
|
|
|
});
|
2016-03-25 01:18:05 -07:00
|
|
|
|
2017-06-12 17:39:03 -07:00
|
|
|
$factory->define(App\Models\Setting::class, function ($faker) {
|
2016-12-19 11:04:28 -08:00
|
|
|
return [
|
2017-06-12 17:39:03 -07:00
|
|
|
'user_id' => 1,
|
|
|
|
'per_page' => 20,
|
|
|
|
'site_name' => $faker->sentence,
|
|
|
|
'auto_increment_assets' => false,
|
|
|
|
'alert_email' => $faker->safeEmail(),
|
|
|
|
'alerts_enabled' => false,
|
|
|
|
'brand' => 1,
|
|
|
|
'default_currency' => $faker->currencyCode,
|
|
|
|
'locale' => $faker->locale,
|
2017-08-25 03:40:56 -07:00
|
|
|
'pwd_secure_min' => 5,
|
2016-12-19 11:04:28 -08:00
|
|
|
];
|
2016-03-25 01:18:05 -07:00
|
|
|
});
|