PHPackages                             treconyl/images-upload - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. treconyl/images-upload

ActiveLibrary[Image &amp; Media](/categories/media)

treconyl/images-upload
======================

Gói Laravel hỗ trợ tải lên, nén và xử lý ảnh.

v2.0.8(1y ago)1622MITPHPPHP ^8.0

Since Jan 8Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/treconyl/images-upload)[ Packagist](https://packagist.org/packages/treconyl/images-upload)[ RSS](/packages/treconyl-images-upload/feed)WikiDiscussions main Synced today

READMEChangelog (8)Dependencies (1)Versions (14)Used By (0)

Uploads Image
=============

[](#uploads-image)

Install
-------

[](#install)

```
composer require treconyl/images-upload

php artisan vendor:publish --provider="Treconyl\ImagesUpload\ImagesUploadServiceProvider"

```

User manual Helper ImageUpload
------------------------------

[](#user-manual-helper-imageupload)

```
use Treconyl\ImagesUpload\ImageUpload;

$file = ImageUpload::file($request, 'image')
                    // ->folder()
                    // ->allowedMimetypes()
                    // ->convert()
                    // ->thumbnails()
                    ->store();

- Phương thức file($request, $input, $quantity = 100, $filename_encoding = true, $overwrite = false)
$request Illuminate\Http\Request
$input tên name của input tải lên
$quantity chất lượng hình ảnh muốn thay đổi
$filename_encoding định nghĩa lại tên ảnh ví dụ Ảnh chụp màn hình.jpg => anh-chup-man-hinh.jpg
$overwrite nếu trùng tên có trong hệ thống sẽ tự động thay thế (nên tắt), nếu đang tắt khi tải lên trùng tên sẽ được thêm số vào cuối tệp, ví dụ anh-1.jpg

- Phương thức folder($name = 'default', $timestamp = true, $disk = 'public')
$name tên thư mục tải lên chứa hình ảnh
$timestamp có tự động thêm 1 thư mục con với định dạng July2024 với tháng năm hiện tại hay không? (khuyên dùng dễ kiểm soát ảnh hơn)
$disk tên disks trong config filesystems mà bạn đã cấu hình để tải lên

- Phương thức allowedMimetypes($mime = ['jpeg', 'jpg', 'png', 'gif', 'webp'])
tham số truyền vào là 1 mảng chứa extension muốn kiểm tra khi tải lên, nếu không truyền sẽ lấy từ file config mặc định để kiểm tra extension trước khi tải lên

- Phương thức convert($extension = 'webp')
Chuyển đổi và nén sang 1 định dạng mới (khuyên dùng webp)

- Phương thức thumbnails(['lg' => ['resize' => ['width' => 600]], 'md' => ['resize' => ['width' => 300]]])
Chứa mảng bao gồm các ảnh nhỏ hơn từ ảnh gốc để đáp ứng cho các loại thiết bị iphone, ipad, macbook...
lg, md là ký hiệu cho ảnh thu nhỏ này cũng là thư mục chứa chúng
'resize' => ['width' => 600] có ý nghĩa là sử dụng kỹ thuật nén resize ảnh, có nhiều loại kỹ thuật nén khách nhau tuỳ nhu cầu sử dụng như "resize", "crop", "scale", "scaleDown", "cover", "contain". Xem thêm ở file config/image-upload.php

- Phương thức store()
Hàm end kết thúc xử lý, có thể thay thế bằng log() để hiển thị thông tin kiểm tra lỗi

```

User manual Traits Resizable
----------------------------

[](#user-manual-traits-resizable)

```
- Thêm vào modal bạn muốn sử dụng để lấy các hình ảnh thumbails

use Treconyl\ImagesUpload\Traits\Resizable;
class User extends Model
{
    use HasFactory, Resizable;
}
Sau khi thêm giờ bạn có thể sử dụng được thumbnail và getThumbnail

- Ví dụ khi dùng trong blade.php

Display a single image
@foreach($posts as $post)

@endforeach

Display multiple images
@foreach($posts as $post)
    $images = json_decode($post->images);
    @foreach($images as $image)

    @endforeach
@endforeach

```

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance68

Regular maintenance activity

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~81 days

Recently: every ~63 days

Total

11

Last Release

452d ago

Major Versions

v1.1.4 → v2.0.32024-07-28

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/75132211?v=4)[Lê Quân](/maintainers/treconyl)[@treconyl](https://github.com/treconyl)

---

Top Contributors

[![treconyl](https://avatars.githubusercontent.com/u/75132211?v=4)](https://github.com/treconyl "treconyl (25 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (1 commits)")

### Embed Badge

![Health badge](/badges/treconyl-images-upload/health.svg)

```
[![Health](https://phpackages.com/badges/treconyl-images-upload/health.svg)](https://phpackages.com/packages/treconyl-images-upload)
```

###  Alternatives

[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[ace-of-aces/laravel-image-transform-url

Easy, URL-based image transformations inspired by Cloudflare Images.

17610.6k](/packages/ace-of-aces-laravel-image-transform-url)[sebastienheyd/boilerplate

Laravel Boilerplate based on AdminLTE 3 with blade components, user management, roles, permissions, logs viewer, ...

29420.1k3](/packages/sebastienheyd-boilerplate)[swiss-devjoy/laravel-image-transformations

Add Cloudflare-like image transformations to your app

111.9k](/packages/swiss-devjoy-laravel-image-transformations)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
