From: Vincent Vanwaelscappel Date: Tue, 11 Jun 2019 15:34:26 +0000 (+0200) Subject: #2810 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9765290e73c618add26e7dd8a139b5251c290158;p=cubist_cms-back.git #2810 --- diff --git a/src/app/Console/Commands/InstallCommand.php b/src/app/Console/Commands/InstallCommand.php new file mode 100644 index 0000000..2b56030 --- /dev/null +++ b/src/app/Console/Commands/InstallCommand.php @@ -0,0 +1,52 @@ + 'php artisan gaspertrix:backpack:dropzone:install', + 'Laravel media library' => [ + 'php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="migrations"', + 'php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="config"' + ], + 'Cubist code generation' => ['php artisan cubist:magic:generate'], + 'Database migrations' => [ + 'php artisan migrate', + 'php artisan cubist:magic:migrate' + ], + ]; + + $this->progressBar = $this->output->createProgressBar(count($commands)); + $this->progressBar->start(); + $this->info(' Cubist installation, please wait'); + + foreach ($commands as $label => $command) { + $this->line(' Run ' . $label); + if (is_string($command)) { + $command = [$command]; + } + foreach ($command as $cmd) { + $this->executeProcess($cmd); + } + + $this->progressBar->advance(); + } + $this->info(" Cubist successfully installed."); + } + + +} diff --git a/src/app/Magic/Fields/Files.php b/src/app/Magic/Fields/Files.php index bcfaf72..e98ffd1 100644 --- a/src/app/Magic/Fields/Files.php +++ b/src/app/Magic/Fields/Files.php @@ -3,19 +3,17 @@ namespace Cubist\Backpack\app\Magic\Fields; - -use Cubist\Backpack\CubistBackpackServiceProvider; - class Files extends Field { protected $_mimeTypes = null; protected $_multiple = false; - protected $_adminType = 'dropzone'; - protected $_viewNamespace = CubistBackpackServiceProvider::NAMESPACE . '::fields'; + protected $_adminType = 'dropzone_media'; protected $_databaseType = 'text'; + protected $_collection = 'files'; + protected $_thumbCollection = 'thumbs'; public function getDefaultAttributes() { - return array_merge(parent::getDefaultAttributes(), ['mime_types' => $this->_mimeTypes, 'multiple' => $this->_multiple]); + return array_merge(parent::getDefaultAttributes(), ['mime_types' => $this->_mimeTypes, 'collection' => $this->_collection, 'thumb_collection' => $this->_thumbCollection]); } }