App\Providers\EditorServiceProvider::boot PHP Method

boot() public method

Bootstrap the application events.
public boot ( ) : void
return void
    public function boot()
    {
        $this->app['xe.pluginRegister']->add(Textarea::class);
        AbstractEditor::setImageResolver(function (array $ids) {
            $dimension = $this->app['request']->isMobile() ? 'M' : 'L';
            $fileClass = $this->app['xe.storage']->getModel();
            $files = $fileClass::whereIn('id', $ids)->get();
            $imgClass = $this->app['xe.media']->getHandler(Media::TYPE_IMAGE)->getModel();
            $images = [];
            foreach ($files as $file) {
                $images[] = $imgClass::getThumbnail($this->app['xe.media']->make($file), EditorHandler::THUMBNAIL_TYPE, $dimension);
            }
            return $images;
        });
        $this->app['events']->listen('xe.editor.option.building', function ($editor) {
            $key = $this->app['xe.editor']->getPermKey($editor->getInstanceId());
            if (!$this->app['xe.permission']->get($key)) {
                $this->app['xe.permission']->register($key, new Grant());
            }
        });
        $this->app['events']->listen('xe.editor.render', function ($editor) {
            $this->app['xe.frontend']->js('assets/core/common/js/xe.editor.core.js')->load();
        });
    }
EditorServiceProvider