Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
frasmage committed Nov 13, 2016
2 parents d1974e1 + f4c533c commit 71994d7
Show file tree
Hide file tree
Showing 39 changed files with 469 additions and 192 deletions.
Binary file modified docs/build/doctrees/commands.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/configuration.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/installation.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/media.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/mediable.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/types.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/uploader.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 2722b2b5df7612bff4385ecba0d7e59f
config: bbf7cac85fbbf9441e0e7eba39880a50
tags: 645f666f9bcd5a90fca523b33c5a78b7
86 changes: 85 additions & 1 deletion docs/build/html/_sources/configuration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ An example setup with one private disk (``local``) and one publicly accessible d

::

<?php
//...
'disks' => [
'local' => [
Expand All @@ -33,6 +34,7 @@ Once you have set up as many disks as you need, edit ``config/mediable.php`` to

::

<?php
//...
/*
* Filesystem disk to use if none is specified
Expand All @@ -47,6 +49,85 @@ Once you have set up as many disks as you need, edit ``config/mediable.php`` to
],
//...


Disk Visibility
^^^^^^^^^^^^^^^

This package is able to generate public URLs for accessing media, and uses the disk config to determine how this should be done.

URLs can always be generated for ``Media`` placed on a disk located below the webroot.

::

<?php
'disks' => [
'uploads' => [
'driver' => 'local',
'root' => public_path('uploads'),
],
]

//...

$media->getUrl(); // returns http://domain.com/uploads/foo.jpg

``Media`` placed on a disk located elsewhere will throw an exception.

::

<?php
'disks' => [
'private' => [
'driver' => 'local',
'root' => storage_path('private'),
],
]

//...

$media->getUrl(); // Throws a Plank\Mediable\Exceptions\MediableUrlException

If you are using symbolic links to make local disks accessible, you can instruct the package to generate URLs with the ``'visibility' => 'public'`` key. By default, the package will assume that the symlink is named ``'storage'``, as per `laravel's documentation <https://laravel.com/docs/5.3/filesystem#the-public-disk>`_. This can be modified with the ``'prefix'`` key.

::

<?php
'disks' => [
'public' => [
'driver' => 'local',
'root' => storage_path('public'),
'visibility' => 'public',
'prefix' => 'assets'
],
]

//...

$media->getUrl(); // returns http://domain.com/assets/foo.jpg


Permissions for S3-based disks is set on the buckets themselves. You can inform the package that ``Media`` on an S3 disk can be linked by URL by adding the ``'visibility' => 'public'`` key to the disk congfig.

::

<?php
'disks' => [
'cloud' => [
'driver' => 's3',
'key' => env('S3_KEY'),
'secret' => env('S3_SECRET'),
'region' => env('S3_REGION'),
'bucket' => env('S3_BUCKET'),
'version' => 'latest',
'visibility' => 'public'
],
]

//...

$media->getUrl(); // returns https://s3.amazonaws.com/bucket/foo.jpg


.. _validation:

Validation
Expand All @@ -56,6 +137,7 @@ The `config/mediable.php` offers a number of options for configuring how media u

::

<?php
//...
/*
* The maximum file size in bytes for a single uploaded file
Expand Down Expand Up @@ -106,10 +188,11 @@ Aggregate Types

Laravel-Mediable provides functionality for handling multiple kinds of files under a shared aggregate type. This is intended to make it easy to find similar media without needing to constantly juggle multiple MIME types or file extensions.

The package defines a number of common file types in the config file (config/mediable.php). Feel free to modify the default types provided by the package or add your own. Each aggregate type requires a key used to identify the type and a list of MIME types and file extensions that should be recognized as belonging to that aggregate type. For example, if you wanted to add an aggregate type for different types of markup, you could do the following.
The package defines a number of common file types in the config file (``config/mediable.php``). Feel free to modify the default types provided by the package or add your own. Each aggregate type requires a key used to identify the type and a list of MIME types and file extensions that should be recognized as belonging to that aggregate type. For example, if you wanted to add an aggregate type for different types of markup, you could do the following.

::

<?php
//...
'aggregate_types' => [
//...
Expand Down Expand Up @@ -145,6 +228,7 @@ The ``config/mediable.php`` file lets you specify a number of classes to be use

::

<?php
/*
* FQCN of the model to use for media
*
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/_sources/mediable.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ You can retrieve media attached to a file by refering to the tag to which it was
<?php
$media = $post->getMedia('thumbnail');

This returns a collection of all media assigned to that tag. In cases where you only need one `Media` entity, you can instead use `firstMedia()`.
This returns a collection of all media assigned to that tag. In cases where you only need one ``Media`` entity, you can instead use ``firstMedia()``.

::

Expand Down
8 changes: 4 additions & 4 deletions docs/build/html/commands.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Artisan Commands &mdash; Laravel-Mediable 2.0.0 documentation</title>
<title>Artisan Commands &mdash; Laravel-Mediable 2.2.0 documentation</title>



Expand All @@ -30,7 +30,7 @@



<link rel="top" title="Laravel-Mediable 2.0.0 documentation" href="index.html"/>
<link rel="top" title="Laravel-Mediable 2.2.0 documentation" href="index.html"/>
<link rel="prev" title="Aggregate Types" href="types.html"/>


Expand Down Expand Up @@ -59,7 +59,7 @@


<div class="version">
2.0.0
2.2.0
</div>


Expand Down Expand Up @@ -192,7 +192,7 @@ <h1>Artisan Commands<a class="headerlink" href="#artisan-commands" title="Permal
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'2.0.0',
VERSION:'2.2.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
Expand Down
Loading

0 comments on commit 71994d7

Please sign in to comment.