1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00
invoiceninja/database/seeds/FrequencySeeder.php
2017-02-23 16:33:02 +02:00

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);
}
}
}
}