{"id":15283900,"url":"https://github.com/simtabi/lapload","last_synced_at":"2026-01-05T01:47:53.643Z","repository":{"id":57051501,"uuid":"431936703","full_name":"simtabi/lapload","owner":"simtabi","description":"Livewire upload image component.","archived":false,"fork":false,"pushed_at":"2022-04-11T14:15:43.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-28T23:22:45.260Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simtabi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-25T18:05:40.000Z","updated_at":"2022-03-26T19:56:06.000Z","dependencies_parsed_at":"2022-08-24T03:41:04.405Z","dependency_job_id":null,"html_url":"https://github.com/simtabi/lapload","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simtabi%2Flapload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simtabi%2Flapload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simtabi%2Flapload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simtabi%2Flapload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simtabi","download_url":"https://codeload.github.com/simtabi/lapload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245138081,"owners_count":20566866,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-30T14:48:08.893Z","updated_at":"2026-01-05T01:47:53.607Z","avatar_url":"https://github.com/simtabi.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![lapload](https://banners.beyondco.de/Livewire%20Image%20Uploader.png?theme=light\u0026packageManager=composer+require\u0026packageName=composer+require+simtabi%2Flapload\u0026pattern=endlessClouds\u0026style=style_1\u0026description=\u0026md=0\u0026showWatermark=0\u0026fontSize=100px\u0026images=photograph\u0026widths=400\u0026heights=400)\n\n## Demo\n![uploader-demo](https://media.giphy.com/media/vcUG1LGyCEZV8HkKmG/giphy.gif)\n\n## Features\n- Upload image\n- Upload multiple images\n- Remove image\n\n## Requirements\n- Laravel Livewire 2.0\n\n## Installation\nYou can install the package via composer:\n```bash\ncomposer require simtabi/lapload\n```\n## Usage\nAdd the Livewire directive into component blade page (E.g form-component.blade.php).\n```html\n\u003clivewire:lapload\" name=\"foo\"\u003e \nor\n\u003clivewire:lapload\" name=\"foo\" size=\"2048\" multiple\u003e\n```\n| Props      | Type     | Required | Description|\n| -----------| ---------| :------: |-----------|\n| name       | string   |   ✅    |Parent component public properties to store uploaded images name.|\n| multiple   | bool     |   ❌    |Enable multiple upload. (Default: false)|\n| size       | int      |   ❌    | Image size limit. (Default: 1024KB)|\n\nAdd 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).\n\n```PHP\n\u003c?php\nnamespace App\\Http\\Livewire;\n.\n.\nuse Simtabi\\Lapload\\Traits\\HasLapload;\n\nclass FormComponent extends Component{\n    use HasLapload;\n    public $foo;\n}\n```\nEvery 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.\n\n## Uploaded File\nFor now all uploaded images will be stored inside storage/public/lapload. 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:\n```bash\nphp artisan storage:link\n```\nTo display the image in frontend:\n```html\n\u003cimg src=\"{{ asset('storage/lapload/' . $imageName) }}\"\u003e\n```\n\n## Styling\nTo add the styling, you need publish the package assets folder to your project public folder. To publish the package assets folder run:\n```bash\nphp artisan vendor:publish --provider=\"Simtabi\\Lapload\\LaploadServiceProvider\" --tag=\"assets\"\n```\nNext, include the css file inside the assets folder in your HTML page \u003chead\u003e section:\n```html\n\u003chead\u003e\n     ...\n    \u003clink href=\"{{ asset('lapload/css/app.css') }}\" rel=\"stylesheet\"\u003e\n\u003c/head\u003e\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimtabi%2Flapload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimtabi%2Flapload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimtabi%2Flapload/lists"}