@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
final class PublicRegistration
|
||||
{
|
||||
public static function enabled(): bool
|
||||
{
|
||||
$enabled = DB::table('public_registration_settings')->where('id', 1)->value('enabled');
|
||||
|
||||
return (bool) ($enabled ?? config('fortify.public_registration_default'));
|
||||
}
|
||||
|
||||
public static function setEnabled(bool $enabled): void
|
||||
{
|
||||
DB::table('public_registration_settings')->upsert(
|
||||
['id' => 1, 'enabled' => $enabled],
|
||||
['id'],
|
||||
['enabled'],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user