2017 © Pedro Peláez
 

library laravel-filesystem-url

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

image

benrowe/laravel-filesystem-url

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

  • Friday, August 19, 2016
  • by benrowe
  • Repository
  • 1 Watchers
  • 2 Stars
  • 433 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Laravel Filesystem Url

Build Status Scrutinizer Code Quality Total Downloads Latest Stable Version Latest Unstable Version License, (*1)

Provides a url generation service for your configured filesystems, (*2)

This extends from laravel's filesystem config., (*3)

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., (*4)

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

You can also install this package via the composer command:, (*5)

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., (*6)

Benrowe\Laravel\Url\ServiceProvider::class

Optionally you can register the facade:, (*7)

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

Filesystem

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

Each disk thats configured can have a url key + associated settings, (*9)

'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)., (*10)

Usage

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

It can be accessed in the following ways:, (*12)

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, (*13)

@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.

The Versions

19/08 2016

dev-master

9999999-dev https://github.com/benrowe/laravel-filesystem-url

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel url

19/08 2016

v1.0.3

1.0.3.0 https://github.com/benrowe/laravel-filesystem-url

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel url

04/07 2016

v1.0.2

1.0.2.0 https://github.com/benrowe/laravel-filesystem-url

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

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel url

15/12 2015

v1.0.1

1.0.1.0 https://github.com/benrowe/laravel-filesystem-url

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

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel url

15/12 2015

v1.0.0

1.0.0.0 https://github.com/benrowe/laravel-filesystem-url

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

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel url

15/12 2015

0.1

0.1.0.0 https://github.com/benrowe/laravel-filesystem-url

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

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

laravel url