Skip to content

Commit 1b70061

Browse files
committed
make namespaced settings
1 parent 1f92bda commit 1b70061

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

database/migrations/create_settings_table.php.stub

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ return new class extends Migration
1616
$table->string('name');
1717
$table->json('value');
1818

19-
$table->json('metadata')->default('{}');
19+
$table->json('metadata');
2020

2121
$table->nullableMorphs('model');
2222

src/NamespacedSettings.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@
1010

1111
abstract class NamespacedSettings
1212
{
13-
public function __construct()
13+
final public function __construct()
1414
{
1515
$this->load();
1616
}
1717

18+
public static function make(): static
19+
{
20+
return new static;
21+
}
22+
1823
abstract public static function getNamespace(): string;
1924

2025
public function load(): static

0 commit comments

Comments
 (0)