承接 benrowe/laravel-filesystem-url 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

benrowe/laravel-filesystem-url

Composer 安装命令:

composer require benrowe/laravel-filesystem-url

包简介

A laravel component for generating public endpoints for assets within the filesystem

关键字:

README 文档

README

Build Status Scrutinizer Code Quality Total Downloads Latest Stable Version Latest Unstable Version License

Provides a url generation service for your configured filesystems

This extends from laravel's filesystem config.

Installation

Composer

Simply add a dependency on benrowe/laravel-filesystem-url to your project's composer.json file if you use Composer to manage the dependencies of your project.

{
    "require-dev": {
         "benrowe/laravel-filesystem-url": "*"
    }
}

You can also install this package via the composer command:

composer require 'benrowe/laravel-filesystem-url=*'

Configuration

Service Provider + Facade

Once you've installed the package via composer, you need to register the provided service provider into laravel's provider stack.

Benrowe\Laravel\Url\ServiceProvider::class

Optionally you can register the facade:

'Url' => Benrowe\Laravel\Url\Facade::class,

Filesystem

The url builder uses the existing filesystem config, by extending it with some additional details.

Each disk thats configured can have a url key + associated settings

'local' => [
    'url' => [
        'base' => 'http://localhost',
        'baseSecure' => 'https://localhost', // optional
        'prefix' => 'assets', // optional
        'enabled' => true, //optional
    ]
]

Any filesystems that don't have the url key won't allow a url to be generated (throws an exception).

Usage

The primary method is the url($path, $disk = null, $secure = false)

It can be accessed in the following ways:

Facade

Url::url('path/to/file.jpg', 'local', $forceSecure);
// outputs as http://localhost/assets/path/to/file.jpg

Blade Directive

The package provides a convenient blade directive

@url('path/to/file.jpg', 'diskname')
// the blade directive will trap exceptions if the disk doesn't exist, or is not configured correctly.

Todo

  • Dynamic config - ability to get the config for s3 buckets based on other config, api, etc.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-12-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固