info('Remove old combined cs/js'); $soft = $this->option('soft'); $this->deleteFiles(public_path() . '/storage/cache/css/'); $this->deleteFiles(public_path() . '/storage/cache/js/'); $this->warn('Clear config cache'); $this->call('config:cache'); $this->warn("Running module publish"); $this->call("module:publish"); if (!$soft) { $this->warn('Clear cache'); $this->call('cache:clear'); $this->warn('Route cache'); $this->call('route:cache'); } exec('chown -R asterisk:asterisk /var/www/ccsystem/storage'); } /** * @param $folder */ private function deleteFiles($folder) { //Get a list of all of the file names in the folder. $files = glob($folder . '/*'); //Loop through the file list. foreach ($files as $file) { //Make sure that this is a file and not a directory. if (is_file($file)) { //Use the unlink function to delete the file. unlink($file); } } } }