PHP code example of vis / artur_image_storage_l5

1. Go to this page and download the library: Download vis/artur_image_storage_l5 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vis / artur_image_storage_l5 example snippets


    Vis\ImageStorage\ImageStorageServiceProvider::class,

    array(
      'title' => 'Медиахранилище',
      'icon'  => 'picture-o',
      'check' => function() {
          return Sentinel::hasAccess('admin.image_storage.view');
      },
      'submenu' => array(
          array(
              'title' => "Изображения",
              'link'  => '/image_storage/images',
              'check' => function() {
                  return Sentinel::hasAccess('admin.image_storage.view');
              }
          ),
          array(
              'title' => "Галереи",
              'link'  => '/image_storage/galleries',
              'check' => function() {
                  return Sentinel::hasAccess('admin.image_storage.view');
              }
          ),
          array(
              'title' => "Видео",
              'link'  => '/image_storage/videos',
              'check' => function() {
                  return Sentinel::hasAccess('admin.image_storage.view');
              }
          ),
          array(
              'title' => "Видеогалереи",
              'link'  => '/image_storage/video_galleries',
              'check' => function() {
                  return Sentinel::hasAccess('admin.image_storage.view');
              }
          ),
          array(
              'title' => "Документы",
              'link'  => '/image_storage/documents',
              'check' => function() {
                  return Sentinel::hasAccess('admin.image_storage.view');
              }
          ),
          array(
              'title' => "Теги",
              'link'  => '/image_storage/tags',
              'check' => function() {
                  return Sentinel::hasAccess('admin.image_storage.view');
              }
          ),
      )
    ),

    'Медиахранилище' => array(
        'admin.image_storage.view'   => 'Просмотр',
        'admin.image_storage.create' => 'Создание',
        'admin.image_storage.update' => 'Редактирование',
        'admin.image_storage.delete' => 'Удаление',
    ),

    'title' => "Галереи",

    'per_page' => 20,

    'fields' => array(
        ...
    ),

    'size_validation' => array(
        'enabled' => true,
        'max_size' => '1500000',
        'error_message' => "Превышен максимальный размер изображения в [size] MB"
    ),
    'extension_validation' => array(
        'enabled' => true,
        'allowed_extensions' => array('png', 'jpg', 'jpeg'),
        'error_message' => "Допустимы только изображения форматов: [extension_list]"
    ),

    'quality' => 85,

    'optimization' => true,

    'source_title' => true,

    'store_exif' => true,

    'delete_files' => true,

    'rename_files' => true,

    'display_generate_new_size_button' => true,

    'sizes' => array(
        'source' => array(
            'caption' => 'Оригинал',
            'default_tab' => true,
        ),
        'cms_preview' => array(
            'caption' => 'Превью в ЦМС',
            'default_tab' => false,
            'modify' => array(
                'fit' => array(160, 160, function (\Intervention\Image\Constraint $constraint) {
                    $constraint->upsize();
                }),
            ),
        ),

    'sizes' => array(
        'source' => array(
            'caption' => 'Основной файл',
            'default_tab' => true,
        ),
        'ua' => array(
            'caption' => 'Файл на укр',
            'default_tab' => false,
        ),
        'en' => array(
            'caption' => 'Файл на англ',
            'default_tab' => false,
        ),

    ),

    'api_provider' => array(
        'caption' => 'Видео сервис',
        'type' => 'select',
        'options' => config('image-storage.video_api.provider_names')
    ),
    'api_id' => array(
        'caption' => 'Идентификатор видео',
        'type' => 'text',
        'field' => 'string',
        'placeholder' => 'Идентификатор видео',
    ),

    'enabled' => true,

    'cache_minutes' => 60,

    'set_data' => true,

    'provider_names' => array(
        'youtube' => 'Youtube',
        'vimeo'   => 'Vimeo',
    ),

    'providers' => array(
        'youtube' => array(
         ...
        ),
        'vimeo' => array(
        ...
        ),
     )

    'video_existence_url' => '',

    'preview_url' => '',

    'preview_quality' => '',

    'watch_url' => '',

    'embed_url' => '',

    'api_url' => '',

    'api_part' => '',

    'api_key' => '',

    use Vis\ImageStorage\Gallery;
    use Vis\ImageStorage\Image;
    use Vis\ImageStorage\Tag;
    use Vis\ImageStorage\VideoGallery;
    use Vis\ImageStorage\Video;
    use Vis\ImageStorage\Documents;

    public function getSlug()

    public function scopeOrderId(Builder $query, $order = "desc")

    public function scopeActive(Builder $query)

   public function scopeFilterByActivity(Builder $query, array $activity = [])

    public function scopeSlug(Builder $query, $slug = '')

    public function scopeFilterByTitle(Builder $query, $title = '')

    public function scopeFilterByDate(Builder $query, array $date = [])

    public function scopeFilterByTags(Builder $query, array $tags = [])

    public function tags()

    public function galleries()

    public function scopeFilterByGalleries(Builder $query, array $galleries = [])

    public function getUrl()
    {
        return route("vis_images_show_single", [$this->getSlug()]);
    }

    public function getSource($size = 'source')

    public function getFileExtension($size = 'source')

    public function getFileName($size = 'source')

    public function getFileSize($size = 'source')

    public function getFileMimeType($size = 'source')

    public function images()

    public function scopeHasImages(Builder $query)

    public function scopeHasActiveImages(Builder $query)

    public function getUrl()
    {
        return route("vis_galleries_show_single", [$this->getSlug()]);
    }

    public function getGalleryPreviewImage($size = 'cms_preview')

    public function getSource($size = 'source')

    public function getFileExtension($size = 'source')

    public function getFileName($size = 'source')

    public function getFileSize($size = 'source')

    public function getFileMimeType($size = 'source')

    public function preview()

    public function videoGalleries()

    public function api()

    public function scopeFilterByVideoGalleries(Builder $query, array $galleries = [])

    public function getSource()

    public function getUrl()
    {
        return route("vis_videos_show_single", [$this->getSlug()]);
    }

    public function getPreviewImage($size = 'source')

    public function getWatchUrl(array $urlParams);

    public function getEmbedUrl(array $urlParams);

    public function getPreviewUrl();

    public function getApiResponse();

    public function getTitle();

    public function getDescription();

    public function getViewCount();

    public function getLikeCount();

    public function getDislikeCount();

    public function getFavoriteCount();

    public function getCommentCount();

    public function videos()

    public function scopeHasVideos(Builder $query)

    public function scopeHasActiveVideos(Builder $query)

    public function getUrl()
    {
        return route("vis_video_galleries_show_single", [$this->getSlug()]);
    }

    public function images()

    public function documents()

    public function videos()

    public function galleries()

    public function videoGalleries()
json
   php artisan migrate --path=vendor/vis/image_storage_l5/src/Migrations
json
    php artisan vendor:publish --provider="Vis\ImageStorage\ImageStorageServiceProvider" --force