Crop Image Before Upload Using Croppie.js in Laravel 9
In this tutorial, we'll demonstrate how to crop an image in Laravel 9 before uploading it. We already have a post about resizing images before uploading them to servers. We'll be using the Croppie.js jQuery plugin in this tutorial. A CSS and JS file are used by this plugin. Either by placing the plugin files in your application's public folder or by using a CDN link, you can use these plugins. It will be really interesting to watch and quite simple to use in this lesson.
Laravel Installation
Using composer, we will construct a Laravel project. Therefore, please verify that composer is installed on your machine. If not, perhaps this guide can assist you in installing composer on your computer. The command to create a Laravel project is as follows: composer create-project --prefer-dist laravel/laravel blog Laravel's development server can be launched by: php artisan serve URL : 127.0.0.1:8000 assuming your system already has Laravel installed.
Create Images Folder
Navigate to the /public folder located at the application root. Make a folder called images. Inside of it, we will save the created signature photos. Make sure the images folder has the necessary permissions to accept material.
Create Controller
The creation of a controller file is the next step. php artisan make:controller ImageController At the /app/Http/Controllers folder, a file named ImageController.php will be generated. Write the entire code into ImageController.php after opening it. Read the full article













