1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Created IndustrySeeder

This commit is contained in:
Hillel Coren 2016-08-21 19:35:06 +03:00
parent b405ed84da
commit b170dd5fe6
4 changed files with 57 additions and 32 deletions

View File

@ -41,38 +41,6 @@ class ConstantsSeeder extends Seeder
Frequency::create(array('name' => 'Six months'));
Frequency::create(array('name' => 'Annually'));
Industry::create(array('name' => 'Accounting & Legal'));
Industry::create(array('name' => 'Advertising'));
Industry::create(array('name' => 'Aerospace'));
Industry::create(array('name' => 'Agriculture'));
Industry::create(array('name' => 'Automotive'));
Industry::create(array('name' => 'Banking & Finance'));
Industry::create(array('name' => 'Biotechnology'));
Industry::create(array('name' => 'Broadcasting'));
Industry::create(array('name' => 'Business Services'));
Industry::create(array('name' => 'Commodities & Chemicals'));
Industry::create(array('name' => 'Communications'));
Industry::create(array('name' => 'Computers & Hightech'));
Industry::create(array('name' => 'Defense'));
Industry::create(array('name' => 'Energy'));
Industry::create(array('name' => 'Entertainment'));
Industry::create(array('name' => 'Government'));
Industry::create(array('name' => 'Healthcare & Life Sciences'));
Industry::create(array('name' => 'Insurance'));
Industry::create(array('name' => 'Manufacturing'));
Industry::create(array('name' => 'Marketing'));
Industry::create(array('name' => 'Media'));
Industry::create(array('name' => 'Nonprofit & Higher Ed'));
Industry::create(array('name' => 'Pharmaceuticals'));
Industry::create(array('name' => 'Professional Services & Consulting'));
Industry::create(array('name' => 'Real Estate'));
Industry::create(array('name' => 'Retail & Wholesale'));
Industry::create(array('name' => 'Sports'));
Industry::create(array('name' => 'Transportation'));
Industry::create(array('name' => 'Travel & Luxury'));
Industry::create(array('name' => 'Other'));
Industry::create(array('name' => 'Photography'));
Size::create(array('name' => '1 - 3'));
Size::create(array('name' => '4 - 10'));
Size::create(array('name' => '11 - 50'));

View File

@ -26,5 +26,6 @@ class DatabaseSeeder extends Seeder
$this->call('PaymentTermsSeeder');
$this->call('PaymentTypesSeeder');
$this->call('LanguageSeeder');
$this->call('IndustrySeeder');
}
}

View File

@ -0,0 +1,55 @@
<?php
use App\Models\Industry;
class IndustrySeeder extends Seeder
{
public function run()
{
Eloquent::unguard();
$industries = [
['name' => 'Accounting & Legal'],
['name' => 'Advertising'],
['name' => 'Aerospace'],
['name' => 'Agriculture'],
['name' => 'Automotive'],
['name' => 'Banking & Finance'],
['name' => 'Biotechnology'],
['name' => 'Broadcasting'],
['name' => 'Business Services'],
['name' => 'Commodities & Chemicals'],
['name' => 'Communications'],
['name' => 'Computers & Hightech'],
['name' => 'Defense'],
['name' => 'Energy'],
['name' => 'Entertainment'],
['name' => 'Government'],
['name' => 'Healthcare & Life Sciences'],
['name' => 'Insurance'],
['name' => 'Manufacturing'],
['name' => 'Marketing'],
['name' => 'Media'],
['name' => 'Nonprofit & Higher Ed'],
['name' => 'Pharmaceuticals'],
['name' => 'Professional Services & Consulting'],
['name' => 'Real Estate'],
['name' => 'Retail & Wholesale'],
['name' => 'Sports'],
['name' => 'Transportation'],
['name' => 'Travel & Luxury'],
['name' => 'Other'],
['name' => 'Photography'],
['name' => 'Construction'],
];
foreach ($industries as $industry) {
$record = Industry::whereName($industry['name'])->first();
if ( ! $record) {
Industry::create($industry);
}
}
Eloquent::reguard();
}
}

View File

@ -22,5 +22,6 @@ class UpdateSeeder extends Seeder
$this->call('PaymentTermsSeeder');
$this->call('PaymentTypesSeeder');
$this->call('LanguageSeeder');
$this->call('IndustrySeeder');
}
}