geeky/file 问题修复 & 功能扩展

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

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

geeky/file

Composer 安装命令:

composer require geeky/file

包简介

Make laravel files easy to upload 'local | bublic | s3 | ...'

README 文档

README

This package make upload files so easy localy or on cloud just determine what is your disk in the config file and enjoy uploading.

Requirements

For the creation of thumbnails of svg's or pdf's you should also install Imagick.

Installation

Install using composer:

  composer require geeky/file

Then, in config/app.php, add the following to the service providers array.

array(
   ...
  Geeky\File\FileServiceProvider::class,
)

Finally, in config/app.php, add the following to the facades array.

array(
    ...
     'Gfile' => Geeky\file\FileFacade::class,
)

Usage

Example usage using Facade:

Upload file .. If the uploaded file is image it will upload the original image in the path you want and it will make thumbs dir in the same path to store thumb image automatically and you determine the max-width and the quality of thumb images from config file.

Gfile::upload($file , 'path/you/want/');

Delete files.. You can pass a sigle file path or an array of files paths to delete

Gfile::delete($file_path);

Get file visibility.. You can get the visibility of any file you want .. the visibility should be public or private

Gfile::getVisibility($file_path);

Set file visibility.. You can set the visibility of any file you want .. the visibility should be public or private

Gfile::stVisibility($file_path);

You can publish the config-file with:

php artisan vendor:publish --provider="Geeky\File\FileServiceProvider" --tag="config"

This is the contents of the published config file:

<?php

return [

    'maxsize' => 500, // Max vert or horiz resolution

    'quality' => 90, // Set compression level (1 lowest quality, 100 highest quality)

    /*
    |--------------------------------------------------------------------------
    | Filesystem Disks
    |--------------------------------------------------------------------------
    |
    | depends on filesystem configuration
    |
    | Supported Drivers: "local", "ftp", "s3", "rackspace"
    |
    */

    'disk' => 'local', // supported Drivers: "local", "ftp", "s3", "rackspace" 

    /*
    |--------------------------------------------------------------------------
    |
    | In Laravel's Flysystem integration, "visibility" is an abstraction of file permissions across 
    | multiple platforms. Files may either be declared public or private. When a file is declared
    | public, you are indicating that the file should generally be accessible to others. For example, 
    | when using the S3 driver, you may retrieve URLs for public files.
    |
    */

    'visibility' => 'public' // 'public' , 'private'
];

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固