Impment webcron and internal scheduling methods and change settings to a key value store
This commit is contained in:
@@ -6,24 +6,19 @@
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::dropIfExists('settings');
|
||||
|
||||
Schema::create('settings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('invoice_number_format')->default('RE-{number}');
|
||||
$table->integer('invoice_number_start')->default(1);
|
||||
$table->string('key')->primary();
|
||||
$table->text('value')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('settings');
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -7,14 +7,10 @@
|
||||
|
||||
class SettingsTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
Setting::firstOrCreate([], [
|
||||
'invoice_number_format' => 'RE-{number}',
|
||||
'invoice_number_start' => 1,
|
||||
]);
|
||||
Setting::updateOrCreate(['key' => 'invoices.number_format'], ['value' => 'RE-{number}']);
|
||||
Setting::updateOrCreate(['key' => 'invoices.number_start'], ['value' => '1']);
|
||||
Setting::updateOrCreate(['key' => 'app.schedule_method'], ['value' => '1']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user