disable model caching during install/update
This commit is contained in:
		@@ -30,3 +30,5 @@ MAIL_FROM_NAME=null
 | 
			
		||||
MAIL_FROM_ADDRESS=null
 | 
			
		||||
 | 
			
		||||
FIREWALL_ENABLED=false
 | 
			
		||||
 | 
			
		||||
MODEL_CACHE_ENABLED=false
 | 
			
		||||
 
 | 
			
		||||
@@ -24,3 +24,5 @@ MAIL_PASSWORD=null
 | 
			
		||||
MAIL_ENCRYPTION=null
 | 
			
		||||
 | 
			
		||||
FIREWALL_ENABLED=false
 | 
			
		||||
 | 
			
		||||
MODEL_CACHE_ENABLED=false
 | 
			
		||||
 
 | 
			
		||||
@@ -62,6 +62,9 @@ class FinishUpdate extends Command
 | 
			
		||||
        session(['company_id' => $company_id]);
 | 
			
		||||
        setting()->setExtraColumns(['company_id' => $company_id]);
 | 
			
		||||
 | 
			
		||||
        // Disable model cache during update
 | 
			
		||||
        config(['laravel-model-caching.enabled' => false]);
 | 
			
		||||
 | 
			
		||||
        event(new UpdateFinished($alias, $new, $old));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -994,6 +994,7 @@ class Version200 extends Listener
 | 
			
		||||
            'QUEUE_CONNECTION'      =>  'sync',
 | 
			
		||||
            'LOG_CHANNEL'           =>  'stack',
 | 
			
		||||
            'FIREWALL_ENABLED'      =>  'true',
 | 
			
		||||
            'MODEL_CACHE_ENABLED'   =>  'true',
 | 
			
		||||
        ]);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -254,10 +254,11 @@ class Installer
 | 
			
		||||
    {
 | 
			
		||||
        // Update .env file
 | 
			
		||||
        static::updateEnv([
 | 
			
		||||
            'APP_LOCALE'        =>  session('locale'),
 | 
			
		||||
            'APP_INSTALLED'     =>  'true',
 | 
			
		||||
            'APP_DEBUG'         =>  'false',
 | 
			
		||||
            'FIREWALL_ENABLED'  =>  'true',
 | 
			
		||||
            'APP_LOCALE'            =>  session('locale'),
 | 
			
		||||
            'APP_INSTALLED'         =>  'true',
 | 
			
		||||
            'APP_DEBUG'             =>  'false',
 | 
			
		||||
            'FIREWALL_ENABLED'      =>  'true',
 | 
			
		||||
            'MODEL_CACHE_ENABLED'   =>  'true',
 | 
			
		||||
        ]);
 | 
			
		||||
 | 
			
		||||
        // Rename the robots.txt file
 | 
			
		||||
 
 | 
			
		||||
@@ -2,10 +2,10 @@
 | 
			
		||||
 | 
			
		||||
return [
 | 
			
		||||
 | 
			
		||||
    'cache-prefix' => env('MODEL_CACHE_PREFIX', 'model'),
 | 
			
		||||
 | 
			
		||||
    'enabled' => env('MODEL_CACHE_ENABLED', true),
 | 
			
		||||
 | 
			
		||||
    'cache-prefix' => env('MODEL_CACHE_PREFIX', 'model'),
 | 
			
		||||
 | 
			
		||||
    'use-database-keying' => env('MODEL_CACHE_USE_DATABASE_KEYING', true),
 | 
			
		||||
 | 
			
		||||
    'store' => env('MODEL_CACHE_STORE', 'array'),
 | 
			
		||||
 
 | 
			
		||||
@@ -62,6 +62,9 @@ class InstallCommand extends Command
 | 
			
		||||
 | 
			
		||||
        $this->call('cache:clear');
 | 
			
		||||
 | 
			
		||||
        // Disable model cache during installation
 | 
			
		||||
        config(['laravel-model-caching.enabled' => false]);
 | 
			
		||||
 | 
			
		||||
        // Update database
 | 
			
		||||
        $this->call('migrate', ['--force' => true]);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user