mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-15 07:33:04 +01:00
33 lines
789 B
PHP
33 lines
789 B
PHP
<?php
|
|
|
|
use App\Models\Frequency;
|
|
|
|
class FrequencySeeder extends Seeder
|
|
{
|
|
public function run()
|
|
{
|
|
Eloquent::unguard();
|
|
|
|
$frequencies = [
|
|
['name' => 'Weekly'],
|
|
['name' => 'Two weeks'],
|
|
['name' => 'Four weeks'],
|
|
['name' => 'Monthly'],
|
|
['name' => 'Two months'],
|
|
['name' => 'Three months'],
|
|
['name' => 'Four months'],
|
|
['name' => 'Six months'],
|
|
['name' => 'Annually'],
|
|
];
|
|
|
|
foreach ($frequencies as $frequency) {
|
|
$record = Frequency::whereName($frequency['name'])->first();
|
|
if ($record) {
|
|
//$record->save();
|
|
} else {
|
|
Frequency::create($frequency);
|
|
}
|
|
}
|
|
}
|
|
}
|