Git Product home page Git Product logo

livewire-dropzone's Introduction

Hi there, I'm Dasun ๐Ÿ‘‹

I'm a dedicated Laravel developer from the beautiful island of Sri Lanka. I love exploring new technologies and frameworks to develop innovative solutions. Presently, my main focus is contributing to open-source projects.

Connect with Me

livewire-dropzone's People

Contributors

absolutemate avatar dasundev avatar fsmash avatar macerd avatar tominal 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

livewire-dropzone's Issues

wire:model not working

Hi,
I was testing out this package and I discovered that the wire:model attribute does not work.
The attribute is hard-coded in the view and cannot be changed dynamically. The blog post which demonstrates the input does not work.

Is there any workaround for this?

Best regards

Update:
Nvm, I found a solution. I did not recognize that the type is an array.

error Class "Illuminate\Support\Number" not found

Fresh install, using the example codes provided in README and I'm getting this error

<livewire:dropzone
        wire:model="banners"
        :rules="['image','mimes:png,jpeg','max:10420']"
        :multiple="true" />
PHP 8.1.3
laravel 10.19.0
Class "Illuminate\Support\Number" not found

Error on Component

Just added to component to a blade file and received an error:

Cannot assign null to property Dasundev\LivewireDropzone\Http\Livewire\Dropzone::$files of type array

Improvement on dropzone blade file to allow multiple dropzone components on same page

This is a really straightforward issue. We have multiple livewire dropzone components on the same page. Even with "wire:key" the Alpine dropzone javascript does not dispatch the correct "{uuid}" event like with "fileRemoved".

This can easily be fix like so
image

Then the correct event can be dispatched like so
image

Such a minor change that it doesn't really call for a pull request. This is just what I did after publishing the blade file to get this to work for my use case. Setting uuid as a parameter to take in uniquely identifies the Alpine such that the right event gets dispatched. I feel like there is no downside to doing it this way and just gives people the option to add multiple livewire dropzone components on a single page. I need it for forms that are under different tabs on a page.

missing comma

Hey there,
thx for that great component, love using it.

JFYI, since one of the latest versions uve got a misssing comma in the alpine data in the view file ( line 5 )

Have a nice day,
gerhard

does not show thumbnail in production

When using the package on local host the thumbnail appears, but when uploading the package to production the same gives an error in the link, can you help me with this?

Class "Number" not found

Hey there,

Nice repo! I gave it a try and hit a snag similar to #17 :

2024-04-24_00-17

Not sure what Number helper class is used here but it's probably an easy fix by adding its namespace in there.

  • PHP Version 8.1
  • Laravel Version 10.32.1

Error when uploading more than 4 files at a time

if I want to load more than 4 files simultaneously it gives me this error:

VM9528:1 Uncaught SyntaxError: Unexpected token '<', "

"... is not valid JSON
at JSON.parse ()
at XMLHttpRequest. (livewire.js?id=5d8beb2e:566:62)

Message flash not displayed when submitting a form

Hello,

I have a small problem. When submitting the form, the message flash is not displayed.

Here is the code:

ImagesForm.php

class ImagesForm extends Component
{
    use WithFileUploads;

    public $images = [];

    public function save()
    {
        foreach ($this->images as $image) {
            Storage::putFile('upload', new File($image['path']));
        }

        return redirect()->route('images.create')->with('status', __('Created successfully.'));
    }

    public function render()
    {
        return view('livewire.images-form');
    }
}

images-form.blade.php

<div class="submit-address">
    @if (session('status'))
        <div class="p-2 mb-2 bg-success text-white rounded">
            {{ session('status') }}
        </div>
    @endif
    <form wire:submit="save">
           <livewire:dropzone
                wire:model="images"
                :rules="['image', 'mimes:png,jpeg,jpg', 'max:51200']"
                :multiple="true"
            />
    </form>
</div>

ImageCreate.blade.php

<div class="container">
    <div class="my-address">
        <div class="row">
            <div class="col-md-12">
                 <livewire:images-form />
             </div>
         </div>
    </div>
</div>

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.