mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
32 lines
750 B
PHP
32 lines
750 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' => 'Six months'],
|
|
['name' => 'Annually'],
|
|
];
|
|
|
|
foreach ($frequencies as $frequency) {
|
|
$record = Frequency::whereName($frequency['name'])->first();
|
|
if ($record) {
|
|
//$record->save();
|
|
} else {
|
|
Frequency::create($frequency);
|
|
}
|
|
}
|
|
}
|
|
}
|