johan-code/image-thumbs

此包已被弃用,不再维护。没有建议的替代包。

用于通过InterventionImage为模型创建缩略图的trait

v1.2.1 2018-03-04 16:26 UTC

This package is auto-updated.

Last update: 2020-11-06 13:38:45 UTC


README

现在此包不再维护

Laravel image thumbs

通过InterventionImage为模型创建缩略图的trait。

在 Laravel 5.5 上安装

  1. 使用composer安装(在终端中运行)
composer require johan-code/image-thumbs
  1. 发布(在终端中运行)
php artisan vendor:publish --provider="JohanCode\ImageThumbs\ServiceProvider"
  1. /config/image-thumbs.php 中设置上传磁盘的名称
return [
    'disk_name' => 'public'
];
  1. 确保上传磁盘存在并在public中可用。

示例配置 /config/filesystems.php

'disks' => [
    ...
    'public' => [
        'driver' => 'local',
        'root' => storage_path('app/public'),
        'url' => '/storage',
    ],
    ...
],

使用laravel命令创建符号链接(在终端中运行)

php artisan storage:link

在 Laravel 5.4 上安装

config/app.php 中添加服务提供者

'providers' => [
    ...
    JohanCode\ImageThumbs\ServiceProvider::class,
    ...
]

...然后按照主要说明进行操作。