--- /dev/null
+<?php
+
+namespace Cubist\Backpack\app\Console\Commands;
+
+use Cubist\Backpack\app\Magic\Models\CubistMagicAbstractModel;
+use Cubist\Backpack\app\Magic\Util;
+
+class InstallCommand extends CubistCommand
+{
+ protected $signature = 'cubist:install';
+
+ /**
+ * The console command description.
+ *
+ * @var string
+ */
+ protected $description = 'Run all needed installation steps';
+
+ public function handle()
+ {
+ $commands = ["Dropzone" => '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.");
+ }
+
+
+}
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]);
}
}