Skip to content

Commit 29889e9

Browse files
committed
Updated readme and license.
1 parent e0f7220 commit 29889e9

File tree

3 files changed

+63
-12
lines changed

3 files changed

+63
-12
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 RJ
3+
Copyright (c) 2025 CodeByRay (Ray Cuzzart II)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Livewire Media Uploader
22

3-
Reusable **Livewire v3** media uploader with **TailwindCSS** UI, Alpine-powered overlays, and first-class integration with **Spatie Laravel Media Library**. Ships with a **publishable Blade view** so each app can theme it as needed.
3+
Livewire Media Uploader is a reusable Livewire v3 component that integrates seamlessly with Spatie Laravel Media Library. It ships a clean Tailwind Blade view (fully publishable), Alpine overlays for previews and confirmations, drag-and-drop uploads, per-file metadata (caption/description/order), configurable presets, name-conflict strategies, and optional SHA-256 duplicate detection. Drop it in, point it at a model, and you’re shipping in minutes.
44

55
---
66

@@ -78,21 +78,59 @@ The component is registered under **both** aliases:
7878

7979
## Publishing Assets
8080

81-
**Config:**
81+
### Config:
8282
```bash
8383
php artisan vendor:publish --tag=media-uploader-config
8484
```
8585

86-
**Views:**
86+
### Views:
8787
```bash
8888
php artisan vendor:publish --tag=media-uploader-views
8989
```
9090

9191
After publishing, customize the Blade at:
92-
```
92+
```html
9393
resources/views/vendor/media-uploader/livewire/media-uploader.blade.php
9494
```
9595

96+
97+
## Environment variables (optional)
98+
You can override preset limits and accepted types/mimes via .env. These map directly to config/media-uploader.php:
99+
100+
```dotenv
101+
# Livewire Media Uploader (optional)
102+
103+
# Images
104+
MEDIA_TYPES_IMAGES=jpg,jpeg,png,webp,avif,gif
105+
MEDIA_MIMES_IMAGES=image/jpeg,image/png,image/webp,image/avif,image/gif
106+
MEDIA_MAXKB_IMAGES=10240
107+
108+
# Documents
109+
MEDIA_TYPES_DOCS=pdf,doc,docx,xls,xlsx,ppt,pptx,txt
110+
MEDIA_MIMES_DOCS=application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,text/plain
111+
MEDIA_MAXKB_DOCS=20480
112+
113+
# Videos
114+
MEDIA_TYPES_VIDEOS=mp4,mov,webm
115+
MEDIA_MIMES_VIDEOS=video/mp4,video/quicktime,video/webm
116+
MEDIA_MAXKB_VIDEOS=102400
117+
118+
# Fallback preset
119+
MEDIA_TYPES_DEFAULT=jpg,jpeg,png,webp,avif,gif,pdf,doc,docx,xls,xlsx,ppt,pptx,txt
120+
MEDIA_MIMES_DEFAULT=image/jpeg,image/png,image/webp,image/avif,image/gif,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,text/plain
121+
MEDIA_MAXKB_DEFAULT=10240
122+
```
123+
124+
### Notes
125+
- Values are comma-separated; spaces are OK (the package trims them).
126+
- After changing .env, run:
127+
```bash
128+
- php artisan config:clear
129+
# (or) php artisan config:cache
130+
```
131+
- The `````<input accept="…">````` attribute is auto-filled from the active preset when accept_from_config is true (default). You can still override it per-component with the accept prop.
132+
- If uploads fail due to size, make sure your PHP/Server limits also allow it (e.g. upload_max_filesize, post_max_size).
133+
96134
---
97135

98136
## Quick Start
@@ -334,16 +372,16 @@ class User extends Model implements HasMedia
334372

335373
## Roadmap
336374

337-
- Drag-to-reorder (update `order_column`)
338-
- Optional queued conversions hints
375+
- Drag-to-reorder (update `order_column`).
376+
- Show document icon instead of thumbnail in Attached media list if the file is not an image.
339377

340378
PRs welcome!
341379

342380
---
343381

344382
## License
345383

346-
**MIT** © Ray Cuzzart II
384+
**MIT** © CodebyRay (Ray Cuzzart II)
347385

348386
---
349387

composer.json

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
{
22
"name": "codebyray/livewire-media-uploader",
33
"description": "Reusable Livewire v3 media uploader that integrates with Spatie Media Library and ships a publishable view.",
4+
"keywords": [
5+
"laravel",
6+
"livewire",
7+
"spatie",
8+
"media-library",
9+
"spatie-laravel-medialibrary",
10+
"uploader",
11+
"file-uploads",
12+
"tailwindcss",
13+
"alpinejs",
14+
"component"],
415
"type": "library",
516
"license": "MIT",
6-
"version": "dev-main",
717
"authors": [
8-
{ "name": "Ray Cuzzart", "email": "[email protected]" }
18+
{
19+
"name": "CodebyRay",
20+
"email": "[email protected]"
21+
}
922
],
23+
"minimum-stability": "stable",
24+
"prefer-stable": true,
1025
"require": {
1126
"php": ">=8.1",
1227
"livewire/livewire": "^3.0",
@@ -41,8 +56,6 @@
4156
]
4257
}
4358
},
44-
"minimum-stability": "stable",
45-
"prefer-stable": true,
4659
"config": {
4760
"allow-plugins": {
4861
"pestphp/pest-plugin": true

0 commit comments

Comments
 (0)