定制 lee-to/pixel-craft 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lee-to/pixel-craft

最新稳定版本:1.0.1

Composer 安装命令:

composer require lee-to/pixel-craft

包简介

Laravel route image generator

README 文档

README

PixelCraft

Image generator via router in Laravel

Installation

composer require lee-to/pixel-craft
php artisan vendor:publish --provider="Leeto\PixelCraft\PixelCraftServiceProvider"

Usage

1. Set disk and available sized in config

2. Add trait HasGeneratedImage to Model

<?php

namespace App\Models;

use Leeto\PixelCraft\Traits\HasGeneratedImage;
use Illuminate\Database\Eloquent\Model;

class Article extends Model
{
    use HasGeneratedImage;

    // ..

    protected function imageDir(): string
    {
        return 'articles';
    }

    protected function imageColumn(): string
    {
        return 'thumbnail';
    }

    // ..
}

3. Get image

$model->makeImage('200x200')
$model->makeImages('200x200')
$model->makeImage('200x200', 'fit')

统计信息

  • 总下载量: 877
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-30