Laravel Image Handler is an awesome package that can be used to optimize and store images in multiple sizes easily.
Installation
You can install this package via composer by running this command in terminal
Run this command too publish:
Configuration
After installation is done once you can see
Let's deep dive into this package for how to use it
Get Image
Delete Image
For more details, please visit Github.
Closing Note
The team of Codebrisk Laravel developers is always ready to execute even your boldest ideas. Our expert team can design and develop any type of custom CRM solution, SAAS app, or e-commerce app to meet our customer's needs and transform our customer's experiences. Get in touch with our team to discuss your bespoke ideas and learn more about the next steps to launching cooperation.
Installation
composer require codepane/laravel-image-handler
php artisan vendor:publish --provider="codepane\LaravelImageHandler\ImageHandlerServiceProvider"
UsageStore Image
use ImageHandler;
public function store()
{
// its takes the default file name as it is
ImageHandler::store($request->file);
// in 2nd argument you can pass your custom file name with or without the path
ImageHandler::store($request->file, 'file_name_with_or_without_path');
}
use ImageHandler;
public function get()
{
// this will return the original image
ImageHandler::get('original_file_name');
// pass dimension as the second argument to get a specific dimension of the file
ImageHandler::get('original_file_name', 'sm');
}
use ImageHandler;
public function delete()
{
ImageHandler::delete('original_file_name');
}
xYou can install this package via composer by running this command in terminal
Run this command too publish:
Configuration
After installation is done once you can see
imagehandler.php
under the config directory. You can update dimensions, format, and quality as per your need from a configuration file. You can also add a new dimension.Let's deep dive into this package for how to use it
Get Image
Delete Image
For more details, please visit Github.
Closing Note
The team of Codebrisk Laravel developers is always ready to execute even your boldest ideas. Our expert team can design and develop any type of custom CRM solution, SAAS app, or e-commerce app to meet our customer's needs and transform our customer's experiences. Get in touch with our team to discuss your bespoke ideas and learn more about the next steps to launching cooperation.
0 comments:
Post a Comment
Thanks