Git Product home page Git Product logo

advanced-nova-media-library's Introduction

Laravel Advanced Nova Media Library

Manage images of spatie's media library package. Upload multiple images and order them by drag and drop.

Table of Contents

Examples

Cropping Single image upload Multiple image upload Custom properties Generic file management

Install

composer require ebess/advanced-nova-media-library
php artisan vendor:publish --tag=nova-media-library

Model media configuration

Let's assume you configured your model to use the media library like following:

use Spatie\MediaLibrary\MediaCollections\Models\Media;

public function registerMediaConversions(Media $media = null): void
{
    $this->addMediaConversion('thumb')
        ->width(130)
        ->height(130);
}

public function registerMediaCollections(): void
{
    $this->addMediaCollection('main')->singleFile();
    $this->addMediaCollection('my_multi_collection');
}

Generic file management

Generic file management

In order to be able to upload and handle generic files just go ahead and use the Files field.

use Ebess\AdvancedNovaMediaLibrary\Fields\Files;

Files::make('Single file', 'one_file'),
Files::make('Multiple files', 'multiple_files'),

Single image upload

Single image upload

use Ebess\AdvancedNovaMediaLibrary\Fields\Images;

public function fields(Request $request)
{
    return [
        Images::make('Main image', 'main') // second parameter is the media collection name
            ->conversionOnIndexView('thumb') // conversion used to display the image
            ->rules('required'), // validation rules
    ];
}

Multiple image upload

If you enable the multiple upload ability, you can order the images via drag & drop.

Multiple image upload

use Ebess\AdvancedNovaMediaLibrary\Fields\Images;

public function fields(Request $request)
{
    return [
        Images::make('Images', 'my_multi_collection') // second parameter is the media collection name
            ->conversionOnPreview('medium-size') // conversion used to display the "original" image
            ->conversionOnDetailView('thumb') // conversion used on the model's view
            ->conversionOnIndexView('thumb') // conversion used to display the image on the model's index page
            ->conversionOnForm('thumb') // conversion used to display the image on the model's form
            ->fullSize() // full size column
            ->rules('required', 'size:3') // validation rules for the collection of images
            // validation rules for the collection of images
            ->singleImageRules('dimensions:min_width=100'),
    ];
}

Selecting existing media

Selecting existing media Selecting existing media 2

If you upload the same media files to multiple models and you do not want to select it from the file system all over again, use this feature. Selecting an already existing media will copy it.

Attention: This feature will expose an endpoint to every user of your application to search existing media. If your media upload / custom properties on the media models are confidential, do not enable this feature!

  • Publish the config files if you did not yet
artisan vendor:publish --tag=nova-media-library
  • Enable this feature in config file config/nova-media-library
return [
    'enable-existing-media' => true,
];
  • Enable the selection of existing media field
Images::make('Image')->enableExistingMedia(),

Note: This feature does not support temporary URLs.

Names of uploaded images

The default filename of the new uploaded file is the original filename. You can change this with the help of the function setFileName, which takes a callback function as the only param. This callback function has three params: $originalFilename (the original filename like Fotolia 4711.jpg), $extension (file extension like jpg), $model (the current model). Here are just 2 examples of what you can do:

// Set the filename to the MD5 Hash of original filename
Images::make('Image 1', 'img1')
    ->setFileName(function($originalFilename, $extension, $model){
        return md5($originalFilename) . '.' . $extension;
    });

// Set the filename to the model name
Images::make('Image 2', 'img2')
    ->setFileName(function($originalFilename, $extension, $model){
        return str_slug($model->name) . '.' . $extension;
    });

By default, the "name" field on the Media object is set to the original filename without the extension. To change this, you can use the setName function. Like setFileName above, it takes a callback function as the only param. This callback function has two params: $originalFilename and $model.

Images::make('Image 1', 'img1')
    ->setName(function($originalFilename, $model){
        return md5($originalFilename);
    });

Responsive images

If you want to use responsive image functionality from the Spatie MediaLibrary, you can use the withResponsiveImages() function on the model.

Images::make('Image 1', 'img1')
    ->withResponsiveImages();

Image cropping

Cropping

By default you are able to crop / rotate images by clicking the scissors in the left bottom corner on the edit view. The vue-js-clipper is used for this purpose. The cropping feature is limited to mime type of image/jpg, image/jpeg and image/png.

Important: By cropping an existing image the original media model is deleted and replaced by the cropped image. All custom properties are copied form the old to the new model.

To disable this feature use the croppable method:

Images::make('Gallery')->croppable(false);

You can set all configurations like ratio e.g. as following:

Images::make('Gallery')->croppingConfigs(['aspectRatio' => 4/3]);

Available cropping configuration, see https://github.com/timtnleeProject/vuejs-clipper#clipper-basic.

It is possible to enforce cropping on upload, for example to ensure the image has the set aspect ratio:

Images::make('Gallery')->mustCrop();

Disabling cropping by default

By default, the cropping feature is enabled. To disable it by default for all images set default-croppable in config/nova-media-library.php to false:

return [
    'default-croppable' => false,
];

Custom properties

Custom properties

Images::make('Gallery')
    ->customPropertiesFields([
        Boolean::make('Active'),
        Markdown::make('Description'),
    ]);
    
Files::make('Multiple files', 'multiple_files')
    ->customPropertiesFields([
        Boolean::make('Active'),
        Markdown::make('Description'),
    ]);
    
// custom properties without user input
Files::make('Multiple files', 'multiple_files')
    ->customProperties([
        'foo' => auth()->user()->foo,
        'bar' => $api->getNeededData(),
    ]);

Show image statistics (size, dimensions, type)

Image statistics

Images::make('Gallery')
    ->showStatistics();

Custom headers

Images::make('Gallery')
    ->customHeaders([
        'header-name' => 'header-value', 
    ]);

Media Field (Video)

In order to handle videos with thumbnails you need to use the Media field instead of Images. This way you are able to upload videos as well.

use Ebess\AdvancedNovaMediaLibrary\Fields\Media;

class Category extends Resource
{
    public function fields(Request $request)
    {
        Media::make('Gallery') // media handles videos
            ->conversionOnIndexView('thumb')
            ->singleMediaRules('max:5000'); // max 5000kb
    }
}

// ..

class YourModel extends Model implements HasMedia
{
    public function registerMediaConversions(Media $media = null): void
    {
        $this->addMediaConversion('thumb')
            ->width(368)
            ->height(232)
            ->extractVideoFrameAtSecond(1);
    }
}

Temporary Urls

If you are using Amazon S3 to store your media, you will need to use the temporary function on your field to generate a temporary signed URL. This function expects a valid Carbon instance that will specify when the URL should expire.

Images::make('Image 1', 'img1')
    ->temporary(now()->addMinutes(5))

Files::make('Multiple files', 'multiple_files')
    ->temporary(now()->addMinutes(10),

Note: This feature does not work with the existing media feature.

Credits

Alternatives

Change log

v4.0.2 - 2022-04-26

  • Fix ratio for cropping in Nova 4. Config from Images::( ... )->croppingConfigs() are now passed along to the stencil-props property of the cropper. See cropper docs for more details on available props.

v4.0.1 - 2022-04-20

  • Fix details component
  • Fix layout inconsistencies

v4.0.0 - 2022-04-18

  • Upgrade to support Laravel Nova 4
  • Breaks compatibility with Laravel Nova 1,2 and 3. For those nova versions use v3.*
  • Replaced vuejs-clipper with vue-advanced-cropper for vue3 support

Full change log in PR #317

How to contribute

  • You need to have Nova installed of course in your Laravel app
  • Work directly in the package in the vendor directory (webpack needs Nova to be installed)
  • Then from the vendor/xxx/advanced-nova-media-library folder:
    • Use a least nvm use 14
    • yarn install
    • yarn run watch
    • Work hard ๐Ÿค˜
    • yarn npm production when job is finished
    • Make a PR

advanced-nova-media-library's People

Contributors

0xb4lint avatar adriaanzon avatar batformat avatar bernhardh avatar bkintanar avatar blocklogic-au avatar danielztolnai avatar dependabot[bot] avatar ebess avatar garethsomers avatar happydemon avatar ibrahim-mubarak avatar jaap avatar laravel-shift avatar livijn avatar lizzerrg avatar mansoorkhan96 avatar marky291 avatar medteck avatar mertasan avatar milewski avatar mrmonat avatar mucenica-bogdan avatar naifmhd avatar niekbr avatar petyots avatar potsky avatar ragingdave avatar sietzekeuning avatar tobias-grasse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

advanced-nova-media-library's Issues

[Advice needed] For displaying 'pending' or placeholder image whilst conversions complete

Hi and thanks for the great library!

I'm using the library to perform conversions in the background using a queue. When clicking 'Update resource' after adding a given image, I'm usually finding that the resource details page has loaded before the image upload and conversion has completed and thus a a broken image link is shown in the image preview (as shown below).

Screenshot 2019-04-25 at 17 13 10

I'm wondering if there's a nice way of informing the user that the image isn't 'ready' yet, by the use of a placeholder or something to indicate work is still being performed on the image?

Cheers!

Media library using guid

I found a bug when using guid on my media table.
image

That is on file vendor\ebess\advanced-nova-media-library\src\Fields\Images.php
I'm using guid in media table and cast to integer will make an exception..
For now I just remove "(int)" and everything working well..

Undefined method

Call to undefined method App\Propiedad::getMedia()

My model: \App\Propiedad.php

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Spatie\MediaLibrary\Models\Media;

class Propiedad extends Model
{
    protected $table = 'propiedades';


    use SoftDeletes;

    protected $dates = [
        'contrato_inicio',
        'contrato_fin',
    ];

    public function registerMediaConversions(Media $media = null)
    {
        $this->addMediaConversion('thumb')
            ->width(130)
            ->height(130);
    }

    public function registerMediaCollections()
    {
        $this->addMediaCollection('main')->singleFile();
        $this->addMediaCollection('my_multi_collection');
    }


}

Please update composer.json

Please update composer.json to optionally require spatie/laravel-medialibrary "dev-master"
Unable to install.

I need to store images into perticular folder

Hi,

I had used the spatie lib docs., without this nova package, In that project, my requirement is to store the user's images into the user folder, blog images in the blog folder,

so, Lravel media library gives an option:
toMediaCollection(collection name', 'disk_name');
I achieved my requirement through this,
Now, with Nova, I like to do the same, like store the user related images under user folder, and other images are under the related folder,
I can change the collection name through this:
Images::make('Photo', 'user') // second parameter is the media collection name

but how can I change the disk_name. (currently, all the images are stored under public directory directly)

Uploading files requires setting croppingConfigs

When adding a file field:

        return [
            Files::make('My Files', 'my_files')
        ];

The following error is displayed:

image

I think the files upload is incorrectly expecting a cropping config e.g ->croppingConfigs(['ratio' => 16/9]) to work?

Add Cropping Support to Images

Using media conversion does help in restricting the max resolution. However it would be great if we could enforce the aspect ratio

Error if image collection is named like a field of the model

Let's say, you have the following code:

// Model
public function registerMediaCollections() {
    $this->addMediaCollection('main')->singleFile();
    $this->addMediaCollection('content'); // Store images for the content
}

// Nova
public function fields(Request $request) {
    return [
        Text::make('Content', 'content'),
        Images::make('Content-Bilder', 'content')
            >multiple(); // enable upload of multiple images - also ordering
    ];
}

AND your model has a field called "content" (to store the html content itself) you get the error:

image

But if you change the name of the collection to something else, it works:

// Model
public function registerMediaCollections() {
    $this->addMediaCollection('main')->singleFile();
    $this->addMediaCollection('content_imgs'); // Store images for the content
}

// Nova
public function fields(Request $request) {
    return [
        Text::make('Content', 'content'),
        Images::make('Content-Bilder', 'content_imgs')
            >multiple(); // enable upload of multiple images - also ordering
    ];
}

Cannot upload Image

Hello again :)
I just tried to upload a single image following your guide and there seems to be a error
image
I think it's because of wrongly typed property in some of the components but i am still tryin to find it... Thanks in advance

Custom Properties not saving vaules

I've tried using the custom property field as the documentation presents but it won't save any values. If the property doesn't already exist it will create the key but it will only ever set it to null

Images::make('Image') ->customPropertiesFields([ Boolean::make('Active'), Markdown::make('Description'), ])

In addition the custom property popup doesn't block the keyup detection on the detail page, meaning if I open the popup on the detail page and try to type into a field it navigate to the edit view when an e is pressed. Not sure if you'd want to remove the popup on the detail page altogether or override that keyup event.

Put Uploads Into Queue

First off, excellent package, I have been using since the early versions and it has just continued to get even better. Thank you.

An "issue" I am having is the lag when uploading several files at once, especially for an image gallery or video file. The issue becomes compounded when using any image conversions, although Spatie's package allows passing those to a queue behind the scenes. But it would be great to be able to push the main uploads to a background job/queue.

Thoughts?

Custom properties translable ?

Hello,

It's possible to translate the "Custom properties" ?

Example : Im using spatie/laravel-translatable together with DigitalCloud/multilingual-nova

Thanks ;)

Sorting in lens: Call undefined method getMedia()

Thanks for your work, we really like this package. Today we detected the following behaviour.

Our model Tool uses the HasMediaTrait and implements HasMedia.

The fields of the resource Tool look like this:

Images::make(__('models/tool.attributes.image'), 'tool_images')
                ->thumbnail('thumb'),

Text::make(__('models/tool.attributes.name'), 'name')
                ->sortable()
                ->rules('required', 'max:255'),

Everything works fine on the index view, also sorting by name column works.
The Tool resource has a lens which has the same fields and same configuration.
Requesting the lens also works, but sorting by name column in the lens results in the following error:

exception: "Symfony\Component\Debug\Exception\FatalThrowableError"
file: "/app/vendor/ebess/advanced-nova-media-library/src/Fields/Media.php"
line: 209
message: "Call to undefined method stdClass::getMedia()"
trace: [,โ€ฆ]
0: {file: "/app/vendor/laravel/framework/src/Illuminate/Support/HigherOrderCollectionProxy.php", line: 60,โ€ฆ}
1: {file: "/app/vendor/laravel/framework/src/Illuminate/Support/Collection.php", line: 418,โ€ฆ}
2: {file: "/app/vendor/laravel/framework/src/Illuminate/Support/HigherOrderCollectionProxy.php", line: 61,โ€ฆ}
3: {file: "/app/vendor/laravel/nova/src/Lenses/Lens.php", line: 163, function: "__call",โ€ฆ}
4: {file: "/app/vendor/laravel/nova/src/Http/Requests/LensRequest.php", line: 47,โ€ฆ}
5: {file: "/app/app/Nova/Lenses/MyLense.php", line: 33, function: "withOrdering",โ€ฆ}
6: {file: "/app/vendor/laravel/nova/src/Http/Controllers/LensController.php", line: 30, function: "query",โ€ฆ}
7: {function: "show", class: "Laravel\Nova\Http\Controllers\LensController", type: "->"}
8: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Controller.php", line: 54,โ€ฆ}
9: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php", line: 45,โ€ฆ}
10: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Route.php", line: 219,โ€ฆ}
11: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Route.php", line: 176,โ€ฆ}
12: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php", line: 682, function: "run",โ€ฆ}
13: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 30,โ€ฆ}
14: {file: "/app/vendor/laravel/nova/src/Http/Middleware/Authorize.php", line: 18,โ€ฆ}
15: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
16: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
17: {file: "/app/vendor/laravel/nova/src/Http/Middleware/BootTools.php", line: 20,โ€ฆ}
18: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
19: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
20: {file: "/app/vendor/laravel/nova/src/Http/Middleware/DispatchServingNovaEvent.php", line: 20,โ€ฆ}
21: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
22: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
23: {file: "/app/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php", line: 43,โ€ฆ}
24: {file: "/app/vendor/laravel/nova/src/Http/Middleware/Authenticate.php", line: 31, function: "handle",โ€ฆ}
25: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
26: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
27: {file: "/app/vendor/laravel/framework/src/Illuminate/Auth/Middleware/EnsureEmailIsVerified.php",โ€ฆ}
28: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
29: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
30: {file: "/app/app/Http/Middleware/Localization.php", line: 25, function: "Illuminate\Routing\{closure}",โ€ฆ}
31: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
32: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
33: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php",โ€ฆ}
34: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
35: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
36: {file: "/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php",โ€ฆ}
37: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
38: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
39: {file: "/app/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php",โ€ฆ}
40: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
41: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
42: {file: "/app/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php", line: 63,โ€ฆ}
43: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
44: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
45: {,โ€ฆ}
46: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
47: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
48: {file: "/app/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php", line: 66,โ€ฆ}
49: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
50: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
51: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 104,โ€ฆ}
52: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php", line: 684, function: "then",โ€ฆ}
53: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php", line: 659,โ€ฆ}
54: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php", line: 625,โ€ฆ}
55: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Router.php", line: 614,โ€ฆ}
56: {file: "/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", line: 176,โ€ฆ}
57: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 30,โ€ฆ}
58: {file: "/app/vendor/laravel/nova/src/Http/Middleware/ServeNova.php", line: 26,โ€ฆ}
59: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
60: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
61: {file: "/app/vendor/beyondcode/laravel-query-detector/src/QueryDetectorMiddleware.php", line: 33,โ€ฆ}
62: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
63: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
64: {file: "/app/vendor/fideloper/proxy/src/TrustProxies.php", line: 57,โ€ฆ}
65: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
66: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
67: {,โ€ฆ}
68: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
69: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
70: {,โ€ฆ}
71: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
72: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
73: {,โ€ฆ}
74: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
75: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
76: {,โ€ฆ}
77: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 151,โ€ฆ}
78: {file: "/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php", line: 53,โ€ฆ}
79: {file: "/app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php", line: 104,โ€ฆ}
80: {file: "/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", line: 151,โ€ฆ}
81: {file: "/app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php", line: 116,โ€ฆ}
82: {file: "/app/public/index.php", line: 55, function: "handle",โ€ฆ}

Do you have some ideas? Thanks in advance!

Add meta informations to media

Is there a way, to add additional information to media (for example copyright, author, etc.)? You could probably store it in the custom_properties field.

Media ID in folders

Hi there. I'm trying to use this package to upload multiple images to a Resource in Nova.

The thing is, I'm creating the resource with the ID of 24 and I'm uploading 3 images. The result is 3 folders, named 1, 2 and 3 that are created each for an uploaded image. Inside I have the image and the conversions.

Wasn't it supposed to be all stored in a folder called 24 and then inside I would have the 3 images and the conversions folder?

What am I doing wrong?

Thanks!

Unable to save the form

Version: 2.2
Browser: Chrome 72.0.3626 (MacOS)

Error: An invalid form control with name='' is not focusable. (in console)

This error appears when I try to save a resource configured like this.

Images::make('Profile picture', 'profile')
    ->setFileName(function($originalFilename, $extension, $model){
        return md5($originalFilename) . '.' . $extension;
    })
    ->setName(function($originalFilename, $model){
        return Str::slug($model->name);
    })
    ->hideWhenCreating()
    ->hideFromIndex(),

App\Modules\Images\Models\Media not Found

Why are you using use App\Modules\Images\Models\Media;

Shouldn't this be use Spatie\MediaLibrary\Models\Media; ?

<?php

namespace Ebess\AdvancedNovaMediaLibrary\Fields;

use App\Modules\Images\Models\Media;
use Illuminate\Support\Collection;
use Laravel\Nova\Fields\Field;
use Laravel\Nova\Http\Requests\NovaRequest;
use Spatie\MediaLibrary\HasMedia\HasMedia;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Illuminate\Support\Facades\Validator;

DownloadMediaController

Hello, it seems that if u have changed your app name and your namespace is not the default one "App" It breaks the DownloadMediaController on line 8

Unable to upload multiple images (browser starts lagging)

Hi,
i am using your software and it works great. When i upload a single image it works very well. But i noticed that when i want to upload multiple files the upload does not work. The POST request to upload the multiple images just hangs at 0 bytes uploaded. But i noticed that the CPU load and RAM usage spikes a lot after hitting the upload button. The browser tab suddenly needs around 2GB of RAM. I have the same issue in Firefox and Chrome.

Do you have any idea why this happens?
Thanks and greetings
Leo

Documentation error

There are some typos for the advanced example in the rules.

->rules('required|size:1')

should be

->rules('required', 'size:1')

and it is dimensions (plural) in

->singleImageRules(['dimension:min_width=100'])

so it should be

->singleImageRules(['dimensions:min_width=100'])

customProperties e.entries is not a function

Hello,
Im trying to add a custom property to a multiple image field, when I hit the update button nothing happens and in the console I'm getting the following error:

TypeError: e.entries is not a function at a.handleUpdate (media-lib-images-field:1) at a.e (vendor.js?id=b30263b2f9d68433c3ce:1) at a.I3G/.t.$emit (vendor.js?id=b30263b2f9d68433c3ce:1) at a.handleUpdate (media-lib-images-field:1) at submit (media-lib-images-field:1) at e (vendor.js?id=b30263b2f9d68433c3ce:1) at HTMLFormElement.Yr.e._withTask.o._withTask (vendor.js?id=b30263b2f9d68433c3ce:1)

Anyone else facing the same problem?

Please add support for "Custom Properties"

I would be very happy if it was possible to add support for Spatie Media Library customProperties method.

To use, something like this:

Images::make('Logo', 'logo')
            ->withCustomProperties([
                'team_id' => $request->user()->current_team_id,
                'user_id' => $request->user()->id,
                'title' => 'Company Logo'
            ]),

Form alignment for multiple images upload field

Hi,

Why when using the multiple images upload, the form is not align same as other fields?
image

Is there any way if I want to adjust the Gallery field so that it aligned with other fields?
Thanks

Trix Integration

Great work on this package, very useful and cool.

This is clearly in the realm of enhancement, but it would be amazing to be able to drag an Image from the field to be inserted Nova Trix field. Not quite sure if this would be an enhancement to this package, extending the Nova Trix field or a combination of both.

Custom Properties & Generated Conversions

Firstly, thanks so much for the package. It's a huge help to my project.

I am having a little trouble with the Custom Properties portion of the Nova Images Field. If I assign custom properties to an image on creation, the generated_conversions (from spatie/portion of the custom_properties does not get recorded at all. However, if I create the image without adding the custom properties and then EDIT the image and add the custom properties, it retains the generated_conversions portion of the custom_properties field. I hope I am explaining this ok.

These are the values that get added to the database:
Creation without adding a custom prop: {"generated_conversions": {"card": true, "cropped": true, "fullSize": true}}
Creation while adding a custom prop: {"credit": "pixabay", "caption": "new caption"}
Editing a previously added image to add a custom prop: {"credit": "pixabay", "caption": "new caption", "generated_conversions": {"card": true, "cropped": true, "fullSize": true}}

Here is my Images field:
Images::make('Featured Images', 'top_slider') ->conversion('fullSize') ->conversionOnView('cropped') ->thumbnail('card') ->multiple() ->fullSize() ->customPropertiesFields([ Text::make('Credit'), Textarea::make('Caption'), ]) ->hideFromIndex(),

Am I doing this right and this is the expected behavior? Or have I messed something up? Thanks for any info.

Translate strings

First of all, nice package! :)

Is it possible to translate the plugin? Strings such as "Add New Media", "Replace Media", "Add New File"...

call to undefined method stdClass::getMedia()

Hi,

After installing the library and configured my model to use the media library like illustrated, but when I go to the resource index page I get this error message
call to undefined method stdClass::getMedia()

My model:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Spatie\MediaLibrary\Models\Media;

class Offer extends Model
{
    protected $fillable = [
        'title',
        'note',
        'meta',
        'lead_id',
    ];

    protected $casts = [
        'meta' => 'object',
        'win_date' => 'date',
    ];

    public function lead(){
        return $this->belongsTo(Lead::class);
    }

    public function referral(){
        return $this->belongsTo(Referral::class);
    }

    public function registerMediaConversions(Media $media = null)
    {
        $this->addMediaConversion('thumb')
            ->width(130)
            ->height(130);
    }

    public function registerMediaCollections()
    {
        $this->addMediaCollection('main')->singleFile();
        $this->addMediaCollection('my_multi_collection');
    }
}

Customize preview link

This is interesting to link with media resource in nova, and get full control about the generated item and his properties, even custom properties

Unable to select customPropertiesFields

I have added Alt and Caption as a customPropertiesFields array:

return [
            ID::make()->sortable(),
            Images::make('Logo', 'logo')
                ->thumbnail('thumb')
                ->customPropertiesFields([
                    Text::make('Alt Text'),
                    Text::make('Caption'),
                ])
                ->hideFromIndex(),
            SluggableText::make('Name')->sortable(),
            Slug::make('Slug')->hideFromIndex(),
            Text::make('Website URL', 'url')->hideFromIndex()
]

When clicking on the icon nothing happens, I expect the popup to display.

There are no console errors and the crop tool works perfectly.

Could I have missed something?

Option to configure filenames

If you upload an image, the image keeps it original filename like "Fotolia-1224234.jpg". To prevent this, spatie allows to modify the filename with setFilename.

At the moment, there is no way to do this with this package. It would be great, to provide a way, to modify the filename, for example with a callback function. Something like this:

Images::make('Hauptbild', 'main')
    ->setFileName(function($originalFilename, $extension, $model){
        return md5($originalFilename) . "." . $extension;
    });
    
Images::make('Hauptbild', 'main')
    ->setFileName(function($originalFilename, $extension, $model){
        return str_slug($model->name) . "." . $extension;
    });

SVG refused

I defined one of my Mediacollections to allow svg:s.
When I try to upload an svg I get the error; "must be an image".

$this->addMediaCollection('logo')
            ->singleFile()
            ->acceptsFile(function (File $file) {
                return in_array($file->mimeType, ['image/jpeg', 'image/png', 'image/gif', 'image/tiff', 'image/webp', 'image/svg+xml']);
            });

Need temporaryUrl() support for private S3 buckets

We have an S3 bucket for storing media files which is set to 'private'.

Can thumbnails/links of private files be supported in the near future with the temporaryUrl method?
Or did i miss something in the docs?

File size rule

Hom to set file size limit on front end and show error if needed?

question

hi!
default

  1. "Media Media"
    is a media model or
    Kingsley \ NovaMediaLibrary \ Resources \ Media?

  2. I have models "Album" and "Photo", the relationship "one to many."
    can this package save a photo for this connection?
    default

Simple download?

Hello everyone.

Is there an option to download a file instead of showing it in the browser?

Dead?

Is it a dead package?
If yes, any alternatives?

Upload large image

Hello,

I have some lags when I try to upload a image of 4mb.

How I can solve it?

File does not exist

I'm getting this error when attempting to save a new model in laravel nova with a multiple image upload file definition.

Images::make('Images', 'venue_images') ->multiple(),

[2019-03-19 20:24:05] local.ERROR: File /tmp/phpw12t3l does not exist {"userId":1,"exception":"[object] (Spatie\MediaLibrary\Exceptions\FileCannotBeAdded\FileDoesNotExist(code: 0): File /tmp/phpw12t3l does not exist at /app/vendor/spatie/laravel-medialibrary/src/Exceptions/FileCannotBeAdded/FileDoesNotExist.php:12)
[stacktrace]
#0 /app/vendor/spatie/laravel-medialibrary/src/FileAdder/FileAdder.php(209): Spatie\MediaLibrary\Exceptions\FileCannotBeAdded\FileDoesNotExist::create('/tmp/phpw12t3l')
#1 /app/vendor/ebess/advanced-nova-media-library/src/Fields/Media.php(147): Spatie\MediaLibrary\FileAdder\FileAdder->toMediaCollection('venue_images')
#2 [internal function]: Ebess\AdvancedNovaMediaLibrary\Fields\Media->Ebess\AdvancedNovaMediaLibrary\Fields\{closure}(Object(Illuminate\Http\UploadedFile), 0)
#3 /app/vendor/laravel/framework/src/Illuminate/Support/Collection.php(1064): array_map(Object(Closure), Array, Array)
#4 /app/vendor/ebess/advanced-nova-media-library/src/Fields/Media.php(153): Illuminate\Support\Collection->map(Object(Closure))
#5 /app/vendor/ebess/advanced-nova-media-library/src/Fields/Media.php(113): Ebess\AdvancedNovaMediaLibrary\Fields\Media->addNewMedia(Object(Laravel\Nova\Http\Requests\CreateResourceRequest), Array, Object(App\Venue), 'venue_images')
#6 /app/vendor/ebess/advanced-nova-media-library/src/Fields/Media.php(103): Ebess\AdvancedNovaMediaLibrary\Fields\Media->handleMedia(Object(Laravel\Nova\Http\Requests\CreateResourceRequest), Object(App\Venue), 'venue_images', Array)
#7 /app/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(347): Ebess\AdvancedNovaMediaLibrary\Fields\Media->Ebess\AdvancedNovaMediaLibrary\Fields\{closure}(Object(App\Venue))
#8 /app/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(196): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}('eloquent.saved:...', Array)
#9 /app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php(188): Illuminate\Events\Dispatcher->dispatch('eloquent.saved:...', Array)
#10 /app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(704): Illuminate\Database\Eloquent\Model->fireModelEvent('saved', false)
#11 /app/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(675): Illuminate\Database\Eloquent\Model->finishSave(Array)
#12 /app/nova/src/Http/Controllers/ResourceStoreController.php(36): Illuminate\Database\Eloquent\Model->save()
#13 /app/vendor/laravel/framework/src/Illuminate/Database/Concerns/ManagesTransactions.php(29): Laravel\Nova\Http\Controllers\ResourceStoreController->Laravel\Nova\Http\Controllers\{closure}(Object(Phaza\LaravelPostgis\PostgisConnection))
#14 /app/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(347): Illuminate\Database\Connection->transaction(Object(Closure))
#15 /app/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(237): Illuminate\Database\DatabaseManager->__call('transaction', Array)
#16 /app/nova/src/Http/Controllers/ResourceStoreController.php(44): Illuminate\Support\Facades\Facade::__callStatic('transaction', Array)
#17 [internal function]: Laravel\Nova\Http\Controllers\ResourceStoreController->handle(Object(Laravel\Nova\Http\Requests\CreateResourceRequest), 'venues')
#18 /app/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array)
#19 /app/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('handle', Array)
#20 /app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(219): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Laravel\Nova\Http\Controllers\ResourceStoreController), 'handle')
#21 /app/vendor/laravel/framework/src/Illuminate/Routing/Route.php(176): Illuminate\Routing\Route->runController()
#22 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(680): Illuminate\Routing\Route->run()
#23 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#24 /app/nova/src/Http/Middleware/Authorize.php(18): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#25 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Laravel\Nova\Http\Middleware\Authorize->handle(Object(Illuminate\Http\Request), Object(Closure))
#26 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#27 /app/nova/src/Http/Middleware/BootTools.php(20): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#28 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Laravel\Nova\Http\Middleware\BootTools->handle(Object(Illuminate\Http\Request), Object(Closure))
#29 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#30 /app/nova/src/Http/Middleware/DispatchServingNovaEvent.php(20): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#31 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Laravel\Nova\Http\Middleware\DispatchServingNovaEvent->handle(Object(Illuminate\Http\Request), Object(Closure))
#32 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#33 /app/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(43): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#34 /app/nova/src/Http/Middleware/Authenticate.php(31): Illuminate\Auth\Middleware\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure))
#35 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Laravel\Nova\Http\Middleware\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure))
#36 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#37 /app/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(41): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#38 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#39 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#40 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(75): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#41 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#42 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#43 /app/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#44 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#45 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#46 /app/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(56): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#47 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#48 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#49 /app/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#50 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#51 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#52 /app/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(66): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#53 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#54 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#55 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#56 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(682): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#57 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(657): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#58 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(623): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#59 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(612): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#60 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(176): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#61 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#62 /app/nova/src/Http/Middleware/ServeNova.php(26): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#63 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Laravel\Nova\Http\Middleware\ServeNova->handle(Object(Illuminate\Http\Request), Object(Closure))
#64 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#65 /app/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#66 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#67 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#68 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#69 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#70 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#71 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#72 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#73 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#74 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#75 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#76 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#77 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(62): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#78 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#79 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#80 /app/vendor/itsgoingd/clockwork/Clockwork/Support/Laravel/ClockworkMiddleware.php(29): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#81 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(163): Clockwork\Support\Laravel\ClockworkMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#82 /app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#83 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(104): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#84 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(151): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#85 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#86 /app/public/index.php(55): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#87 {main}
"}

Multiple image upload

Hi,
I saw this line in the readme.

If you enable the multiple upload ability, you can order the images via drag & drop.

I have tried to figure out how to enable the multiple upload ability but can't find it & didn't managed to use this library until now. Can someone help to guide me on how to enable the multilple upload ability. Thanks

Can't add same image after removing it

Steps to reproduce:

  1. Create a single file upload field for the resource;
  2. Go to the resource's create page;
  3. Select an image (let's call it "A");
  4. Remove the "A" image without uploading it;
  5. Select the same "A" image again;
  6. Nothing happens ๐Ÿ˜ž;
  7. Select another image "B";
  8. It works! ๐Ÿ˜ƒ
  9. Select the "A" image again and it now works too.

BTW, thanks for the package, very great job so far!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.