An open API service indexing awesome lists of open source software.

https://github.com/simtabi/lapload

Livewire upload image component.
https://github.com/simtabi/lapload

Last synced: 6 months ago
JSON representation

Livewire upload image component.

Awesome Lists containing this project

README

          

![lapload](https://banners.beyondco.de/Livewire%20Image%20Uploader.png?theme=light&packageManager=composer+require&packageName=composer+require+simtabi%2Flapload&pattern=endlessClouds&style=style_1&description=&md=0&showWatermark=0&fontSize=100px&images=photograph&widths=400&heights=400)

## Demo
![uploader-demo](https://media.giphy.com/media/vcUG1LGyCEZV8HkKmG/giphy.gif)

## Features
- Upload image
- Upload multiple images
- Remove image

## Requirements
- Laravel Livewire 2.0

## Installation
You can install the package via composer:
```bash
composer require simtabi/lapload
```
## Usage
Add the Livewire directive into component blade page (E.g form-component.blade.php).
```html

or

```
| 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).

```PHP

```

## Styling
To add the styling, you need publish the package assets folder to your project public folder. To publish the package assets folder run:
```bash
php artisan vendor:publish --provider="Simtabi\Lapload\LaploadServiceProvider" --tag="assets"
```
Next, include the css file inside the assets folder in your HTML page section:
```html

...

```