![]() You just have to use the class and implement in the functions. It is very easy to use intervention image package to resize images. So, here i’ll be continuing directly from the step 4. We are going to have some changes in step 4. Repeat all the process of previous method till step 3. You can always check the official documentation at github. If you have any trouble configuring package. 'Image' => Intervention\Image\Facades\Image::class Similarly, add an aliases in the bottom too. Intervention\Image\ImageServiceProvider::class Open config/app.php and roll down to Laravel framework service providers section and add this line in the bottom. Note :- You can also check the official documentation at github if you have problem following the steps below. I assume that you have already installed the image intervention package as mentioned earlier. Now go to command prompt and type php artisan serve and see if it works. ![]() We are going to create a form inside index.php and upload the image and resizing will be done inside the function so make your form ready inside you PHP function or copy the codes below :. Image Resize By Using PHP Image Processing library (GD Library) Step 1 Also $ php composer.phar require intervention/image if you are on mac or composer require intervention/image if you are on windows.Create new controller named AdminController.php just get it through the php artisan command.Create index.php inside resources/views folder.So i assume you have fresh copy of laravel installed and have already created the file in the specified folders below. We will create the necessary files first which will be used in both of the methods. ![]()
0 Comments
Leave a Reply. |