Download the PHP package sherwinchia/livewire-image-uploader without Composer
On this page you can find all versions of the php package sherwinchia/livewire-image-uploader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sherwinchia/livewire-image-uploader
More information about sherwinchia/livewire-image-uploader
Files in sherwinchia/livewire-image-uploader
Package livewire-image-uploader
Short Description Livewire upload image component.
License MIT
Homepage https://github.com/sherwinchia/livewire-image-uploader
Informations about the package livewire-image-uploader
Demo
Features
- Upload image
- Upload multiple images
- Remove image
Requirements
- Laravel Livewire 2.0
Installation
You can install the package via composer:
Usage
Add the Livewire directive into component blade page (E.g form-component.blade.php).
Props | Type | Required | Description |
---|---|---|---|
name | string | ✅ | Parent component public properties to store uploaded images name. |
multiple | bool | ❌ | Enable multiple upload. (Default: false) |
size | int | ❌ | Image size limit. (Default: 1024KB) |
Add public properties to store the name of the images uploaded in array and use the ImageUploader trait in the component code (E.g FormComponent.php).
Every time there are changes on the images (remove/upload), the component will trigger an event which trigger method in the parent component. The method will update the $foo properties with an array of new images name.
Uploaded File
For now all uploaded images will be stored inside storage/public/image-uploader. To access the image from the frontend you need to create a symbolic link from public/storage to storage/app/public. To create the symbolic link run:
To display the image in frontend:
Styling
To add the styling, you need publish the package assets folder to your project public folder. To publish the package assets folder run:
Next, include the css file inside the assets folder in your HTML page
section: