sqlite
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
@@ -20,6 +21,13 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
if (config('database.default') === 'sqlite') {
|
||||
DB::statement('PRAGMA journal_mode=WAL');
|
||||
DB::statement('PRAGMA synchronous=NORMAL');
|
||||
DB::statement('PRAGMA busy_timeout=5000');
|
||||
DB::statement('PRAGMA foreign_keys=ON');
|
||||
}
|
||||
|
||||
try {
|
||||
$companyName = Setting::query()->where('key', 'company_name')->value('value');
|
||||
$timezone = Setting::query()->where('key', 'timezone')->value('value');
|
||||
|
||||
Reference in New Issue
Block a user