alimohammaddev / image-uploader
A Laravel-ready image uploader package that supports validation, MIME filtering, and safe unique naming for uploaded files.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/alimohammaddev/image-uploader
Requires
- php: ^8.1
README
A Laravel-ready image uploader package that supports validation, MIME filtering, and safe unique naming for uploaded files.
Installation
Require the package via Composer:
composer require alimohammaddev/image-uploader ## Usage ## Upload a new image use ImageUploader\Facades\ImageUploader; Route::post('/upload', function () { $path = ImageUploader::upload(request()->file('image')); return response()->json(['path' => $path]); }); ## Upate a new image use ImageUploader\Facades\ImageUploader; Route::post('/update', function () { $oldPath = 'images/old-image-name.png'; $newPath = ImageUploader::update(request()->file('image'),$oldPath); return response()->json(['path' => $newPath]); });