mirror of
https://gitlab.com/omair-personal/izyim.git
synced 2026-08-19 04:14:05 +00:00
large commit
This commit is contained in:
@@ -4,13 +4,14 @@ use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\AddressBook::class, function (Faker $faker) {
|
||||
return [
|
||||
'company_id' => $faker->numberBetween(1, 30),
|
||||
'reference' => $faker->name,
|
||||
'contact' => $faker->numerify('01########'),
|
||||
'reference' => $faker->firstName.' '.$faker->lastName,
|
||||
'contact' => $faker->phoneNumber,
|
||||
'street_one' => $faker->streetAddress,
|
||||
'city' => $faker->city,
|
||||
'state' => $faker->city,
|
||||
'state' => $faker->state,
|
||||
'post_code' => $faker->postcode,
|
||||
'country' => $faker->country
|
||||
'country' => 'Malaysia',
|
||||
'default' => 1,
|
||||
'billing' => 1
|
||||
];
|
||||
});
|
||||
|
||||
@@ -4,7 +4,7 @@ use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\Company::class, function (Faker $faker) {
|
||||
return [
|
||||
'name' => $faker->company,
|
||||
'name' => $faker->firstName.' '.$faker->companySuffix,
|
||||
'marking' => 'CIEF/'.$faker->numerify('###').$faker->regexify('[A-Z]{3}'),
|
||||
'email' => $faker->companyEmail,
|
||||
'registration_no' => $faker->numerify('######-W'),
|
||||
|
||||
@@ -15,7 +15,7 @@ class CreateCompaniesTable extends Migration
|
||||
{
|
||||
Schema::create('companies', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name', 80);
|
||||
$table->string('name');
|
||||
$table->string('marking', 80)->unique();
|
||||
$table->string('email', 80)->nullable();
|
||||
$table->string('wechat_id', 80)->nullable();
|
||||
|
||||
@@ -16,7 +16,7 @@ class CreateAddressBookTable extends Migration
|
||||
Schema::create('address_book', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('company_id')->unsigned()->index();
|
||||
$table->string('reference', 50)->nullable();
|
||||
$table->string('reference')->nullable();
|
||||
$table->string('contact', 25)->nullable();
|
||||
$table->string('street_one', 80)->nullable();
|
||||
$table->string('street_two', 80)->nullable();
|
||||
|
||||
@@ -15,7 +15,7 @@ class CreateWarehousesTable extends Migration
|
||||
{
|
||||
Schema::create('warehouses', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name', 50);
|
||||
$table->string('name');
|
||||
$table->string('email', 80)->nullable();
|
||||
$table->string('street_one', 80)->nullable();
|
||||
$table->string('street_two', 80)->nullable();
|
||||
|
||||
@@ -11,6 +11,6 @@ class AddressBookTableSeeder extends Seeder
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
factory(App\Models\AddressBook::class, 300)->create();
|
||||
factory(App\Models\AddressBook::class, 2)->create();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ class CompaniesTableSeeder extends Seeder
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
factory(App\Models\Company::class, 30)->create();
|
||||
factory(App\Models\Company::class, 30)->create()->each(function ($company) {
|
||||
$company->addressBook()->save(factory(App\Models\AddressBook::class)->make());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class DatabaseSeeder extends Seeder
|
||||
public function run(): void {
|
||||
if(app()->environment() !== "production"){
|
||||
$this->call(CompaniesTableSeeder::class);
|
||||
$this->call(AddressBookTableSeeder::class);
|
||||
// $this->call(AddressBookTableSeeder::class);
|
||||
$this->call(ContactsTableSeeder::class);
|
||||
$this->call(WarehousesTableSeeder::class);
|
||||
// $this->call(OrdersTableSeeder::class);
|
||||
|
||||
Reference in New Issue
Block a user