UnsplashPicker

Select and upload image from Unsplash directly from your backend.

Back to UnsplashPicker Support

hambern
hambern

Hi I'm trying to implement this plugin om the blog plugin but I just keep getting this error when I want to add a photo:

"Class 'October\Rain\Support\Facades\Validator' not found" on line 77 of /srv/users/…/plugins/sunlab/unsplashpicker/formwidgets/UnsplashPicker.php

What am I doing wrong?

use System\Classes\PluginBase;
use RainLab\Blog\Controllers\Posts as PostsController;
use RainLab\Blog\Models\Post as PostModel;

class Plugin extends PluginBase
{
    public $require = [
        'RainLab.Blog',
        'SunLab.UnsplashPicker',
    ];

    public function boot()
    {
        PostsController::extendFormFields(function ($form, $model) {
            if (!$model instanceof PostModel) return;
            $form->addSecondaryTabFields([
                'featured_images' => [
                    'tab' => 'rainlab.blog::lang.post.tab_manage',
                    'label' => 'rainlab.blog::lang.post.featured_images',
                    'type' => 'unsplashpicker',
                    'mode' => 'image',
                    'maxFilesize' => '12',
                    'imageWidth' => '200',
                    'imageHeight' => '200',
                    'attachOnUpload' => 'true'
                ]
            ]);
        });
    }
}

Last updated

romainmazb62984
romainmazb62984

Hi, sorry for the elapsed time. You didn't do anything wrong, this bug has been reported on GitHub (I'm not so active on the forum) and fixed into 1.0.4,

Unfortunately, due to the new version of October and a new package development process, you won't get the update from the marketplace or backend.

You can still update yourself the files

Last updated

daftspunky
daftspunky

These facades do not exist in older versions of October CMS either.

Do a search and replace for use October\Rain\Support\Facades\Validator and replace it with use Validator. This is the official method that is supported in v1 and v2 and has been improved in v2.

1-3 of 3