sarowar/laravel-dynamic-file-upload 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

sarowar/laravel-dynamic-file-upload

最新稳定版本:2.0.0

Composer 安装命令:

composer require sarowar/laravel-dynamic-file-upload

包简介

A Laravel package for handling file uploads with support for validation, multiple file types, and storage options (local, s3, etc.).

README 文档

README

LaravelFileUpload is a simple package for uploading and processing files (images, PDFs, etc.) in a Laravel application. It supports image resizing using the Intervention Image library and allows you to handle file uploads to both public and storage directories.

Version

Current Version: 2.0.0

Features

- Upload files (images, PDFs, etc.)
- Resize images (optional)
- Save files to public or storage directories
- Automatic directory creation if it doesn't exist
- Handles deletion of existing files before uploading a new one

Installation

You can install the package via Composer:

composer require sarowar/laravel-dynamic-file-upload

Publishing Configuration

To publish the configuration file, run the following command:

php artisan vendor:publish --provider="Sarowar\LaravelFileUpload\FileUploadServiceProvider"
  • This will create a configuration file named sarowar-file-upload.php in the config directory of your Laravel application. You can customize the settings in this file according to your requirements.

Usage

Here’s a basic example of how to use the slug generator:

use Sarowar\LaravelFileUpload\FileUpload;
// Create an instance of the fileupload
$fileUpload = new FileUpload();
// Generate a fileupload
 $fileUpload->fileUpload( $uploadedFile, // Image object
            'uploads/',    // Upload directory
            'static-pdf',// Image name prefix
            '300',//width in this image 
            '300',// Height in this image
            'webp'// extension in this image if you want to change 
        );

Configuration

You can customize the slug generation by modifying the config/sarowar-file-upload.php file. Options include:

-'file_path' => 'storage', // Change to 'storage' if you prefer to use the storage folder

Contributing

  • Contributions are welcome! Please open an issue or submit a pull request.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-24