Skip to content

Commit 334b5de

Browse files
committed
fix: don't create database inside a phar
1 parent 212f11b commit 334b5de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/NativeServiceProvider.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use Native\Laravel\Logging\LogWatcher;
2626
use Native\Laravel\PowerMonitor as PowerMonitorImplementation;
2727
use Native\Laravel\Windows\WindowManager as WindowManagerImplementation;
28+
use Phar;
2829
use Spatie\LaravelPackageTools\Package;
2930
use Spatie\LaravelPackageTools\PackageServiceProvider;
3031

@@ -148,7 +149,8 @@ public function rewriteDatabase()
148149
{
149150
$databasePath = config('nativephp-internal.database_path');
150151

151-
if (config('app.debug')) {
152+
// Automatically create the database in development mode but not if we are running in a Phar
153+
if (config('app.debug') && ! Phar::running()) {
152154
$databasePath = database_path('nativephp.sqlite');
153155

154156
if (! file_exists($databasePath)) {

0 commit comments

Comments
 (0)