diff --git a/database/seeds/ConstantsSeeder.php b/database/seeds/ConstantsSeeder.php index 0200af1ee34d..299cc2a669a1 100644 --- a/database/seeds/ConstantsSeeder.php +++ b/database/seeds/ConstantsSeeder.php @@ -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')); diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 1abaa76b64a8..1a08e1cc697b 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -26,5 +26,6 @@ class DatabaseSeeder extends Seeder $this->call('PaymentTermsSeeder'); $this->call('PaymentTypesSeeder'); $this->call('LanguageSeeder'); + $this->call('IndustrySeeder'); } } diff --git a/database/seeds/IndustrySeeder.php b/database/seeds/IndustrySeeder.php new file mode 100644 index 000000000000..f6461b950a58 --- /dev/null +++ b/database/seeds/IndustrySeeder.php @@ -0,0 +1,55 @@ + '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(); + } +} diff --git a/database/seeds/UpdateSeeder.php b/database/seeds/UpdateSeeder.php index b407a7ba2e63..a4dcc2e4f3bb 100644 --- a/database/seeds/UpdateSeeder.php +++ b/database/seeds/UpdateSeeder.php @@ -22,5 +22,6 @@ class UpdateSeeder extends Seeder $this->call('PaymentTermsSeeder'); $this->call('PaymentTypesSeeder'); $this->call('LanguageSeeder'); + $this->call('IndustrySeeder'); } }