diff --git a/docs/build/doctrees/commands.doctree b/docs/build/doctrees/commands.doctree index 073603e..f90228f 100644 Binary files a/docs/build/doctrees/commands.doctree and b/docs/build/doctrees/commands.doctree differ diff --git a/docs/build/doctrees/configuration.doctree b/docs/build/doctrees/configuration.doctree index fd5e76f..d19b551 100644 Binary files a/docs/build/doctrees/configuration.doctree and b/docs/build/doctrees/configuration.doctree differ diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle index 4820947..68ba116 100644 Binary files a/docs/build/doctrees/environment.pickle and b/docs/build/doctrees/environment.pickle differ diff --git a/docs/build/doctrees/index.doctree b/docs/build/doctrees/index.doctree index 7300586..17b0b10 100644 Binary files a/docs/build/doctrees/index.doctree and b/docs/build/doctrees/index.doctree differ diff --git a/docs/build/doctrees/installation.doctree b/docs/build/doctrees/installation.doctree index 548b901..70d09aa 100644 Binary files a/docs/build/doctrees/installation.doctree and b/docs/build/doctrees/installation.doctree differ diff --git a/docs/build/doctrees/media.doctree b/docs/build/doctrees/media.doctree index 5fd6b84..2287229 100644 Binary files a/docs/build/doctrees/media.doctree and b/docs/build/doctrees/media.doctree differ diff --git a/docs/build/doctrees/mediable.doctree b/docs/build/doctrees/mediable.doctree index 65bd979..6716d9c 100644 Binary files a/docs/build/doctrees/mediable.doctree and b/docs/build/doctrees/mediable.doctree differ diff --git a/docs/build/doctrees/types.doctree b/docs/build/doctrees/types.doctree index 2d97ded..4e2b0cf 100644 Binary files a/docs/build/doctrees/types.doctree and b/docs/build/doctrees/types.doctree differ diff --git a/docs/build/doctrees/uploader.doctree b/docs/build/doctrees/uploader.doctree index a8a357e..19dcbc6 100644 Binary files a/docs/build/doctrees/uploader.doctree and b/docs/build/doctrees/uploader.doctree differ diff --git a/docs/build/html/.buildinfo b/docs/build/html/.buildinfo index 717ba21..49bb039 100644 --- a/docs/build/html/.buildinfo +++ b/docs/build/html/.buildinfo @@ -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 diff --git a/docs/build/html/_sources/configuration.txt b/docs/build/html/_sources/configuration.txt index ab60e27..25fed20 100644 --- a/docs/build/html/_sources/configuration.txt +++ b/docs/build/html/_sources/configuration.txt @@ -14,6 +14,7 @@ An example setup with one private disk (``local``) and one publicly accessible d :: + [ 'local' => [ @@ -33,6 +34,7 @@ Once you have set up as many disks as you need, edit ``config/mediable.php`` to :: + [ + '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. + +:: + + [ + '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 `_. This can be modified with the ``'prefix'`` key. + +:: + + [ + '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. + +:: + + [ + '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 @@ -56,6 +137,7 @@ The `config/mediable.php` offers a number of options for configuring how media u :: + [ //... @@ -145,6 +228,7 @@ The ``config/mediable.php`` file lets you specify a number of classes to be use :: + 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()``. :: diff --git a/docs/build/html/commands.html b/docs/build/html/commands.html index 124da73..046dc5b 100644 --- a/docs/build/html/commands.html +++ b/docs/build/html/commands.html @@ -8,7 +8,7 @@ - Artisan Commands — Laravel-Mediable 2.0.0 documentation + Artisan Commands — Laravel-Mediable 2.2.0 documentation @@ -30,7 +30,7 @@ - + @@ -59,7 +59,7 @@
- 2.0.0 + 2.2.0
@@ -192,7 +192,7 @@

Artisan Commands var DOCUMENTATION_OPTIONS = { URL_ROOT:'./', - VERSION:'2.0.0', + VERSION:'2.2.0', COLLAPSE_INDEX:false, FILE_SUFFIX:'.html', HAS_SOURCE: true diff --git a/docs/build/html/configuration.html b/docs/build/html/configuration.html index ab6d61b..3045652 100644 --- a/docs/build/html/configuration.html +++ b/docs/build/html/configuration.html @@ -8,7 +8,7 @@ - Configuration — Laravel-Mediable 2.0.0 documentation + Configuration — Laravel-Mediable 2.2.0 documentation @@ -30,7 +30,7 @@ - + @@ -60,7 +60,7 @@
- 2.0.0 + 2.2.0
@@ -85,7 +85,10 @@