https://github.com/zalanihir/image-service
https://github.com/zalanihir/image-service
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zalanihir/image-service
- Owner: ZalaNihir
- Created: 2024-05-19T05:35:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-19T05:40:38.000Z (over 1 year ago)
- Last Synced: 2025-03-29T21:24:29.367Z (7 months ago)
- Language: PHP
- Size: 1000 Bytes
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
```bash
imageService = $imageService;
}public function upload(Request $request)
{
// Example usage of ImageService
$image = $request->file('image');
$uniqueSlug = 'example'; // Generate unique slug
$type = 'slider'; // Example type
$path = 'uploads'; // Example path
$extension = 'webp'; // Example extension$filename = $this->imageService->convert($image, $uniqueSlug, $type, $path, $extension);
if ($filename) {
// Image converted successfully
return response()->json(['success' => true, 'filename' => $filename]);
} else {
// Handle conversion failure
return response()->json(['success' => false, 'message' => 'Failed to convert image.']);
}
}
}```