Ejemplo n.º 1
0
 /**
  * RelatedMedia constructor.
  * @param Model $model
  */
 public function __construct(Model $model, $args = null)
 {
     parent::__construct();
     // The RelatedMedia contract is required by the model.
     if (!$model instanceof \Birdmin\Contracts\RelatedMedia) {
         return $this->canRender = false;
     }
     $this->parent($model);
     $this->dropzone = Dropzone::create()->handler('relate', cms_url('media/upload'))->relate($model);
 }
Ejemplo n.º 2
0
 /**
  * Display the media upload form.
  * @param Request $request
  * @return \Illuminate\Http\Response
  */
 public function create(Request $request)
 {
     $this->setActions([Button::create()->parent($this->class)->link('home'), Button::create()->parent($this->class)->link('view'), Button::create()->parent($this->class)->link('upload')->active()]);
     $this->setData('dropzone', Dropzone::create()->handler('default', cms_url('media/upload')));
     return $this->birdmin('cms::media.upload');
 }