Skip to main content

Posts

Showing posts from June, 2020

Image Orientation in PHP

                     Image Orientation in PHP How to fixed Correct Orientation rotate image problem . Solution:- public function imageOrientaionUpload(Request $request) {     $publicPath = public_path('uploads_directory/');     if($request->file('imgFile') == null) {         echo 'No File Exist';     }     $file = $request->file('imgFile');     // generating unique name for uploaded file     $uniq = uniqid().time();     $uploadFile = $uniq.'.'.$file->getClientOriginalExtension();     // getting file path     $filePath = $file->getPathName();     // image rotation code in php starts here     $exif = @exif_read_data($filePath);     if(isset($exif['Orientation'])) {         $orientation = $exif['Orientation'...

RSS FEED Laravel

RSS FEED IN LARAVEL Installation The Laravel 5/6/7 Feeds Service Provider can be installed via Composer by requiring the willvincent/feeds package in your project's  composer.json. {     "require": {         "willvincent/feeds": "1.1.*"     } } Configuration If you're using Laravel 5.5 or newer you may skip the next step. To use the Feeds Service Provider, you must register the provider when bootstrapping your Laravel application. Find the providers key in your   config/app.php  and register the Service Provider.      'providers' => [         // ...         willvincent\Feeds\FeedsServiceProvider::class,     ], Find the aliases key in your config/app.php and register the Facade.      'aliases' => [         // ...         'Feeds'    => willvincent\Feeds\Facades\FeedsFacade::class,     ], ...

How to set selected value of jquery select2

        How to set selected value of jquery select2 Example 1: $ ( '#all_contacts' ). select2 ( 'data' , { id : '123' , text : 'res_data.primary_email' }); Example 2:- <select name = "mySelect2" id = "mySelect2" > <option value = "0" > A </option> <option value = "1" > B </option> <option value = "2" > C </option> </select> /* //////////// "One" will be the selected option */ $ ( '[name=mySelect2]' ). val ( "0" ); You can also do so: $ ( "#mySelect2" ). select2 ( "val" , "0" );

Laravel Change Timezone

Change time zone laravel  Step 1:-  select path app/config/app.php change timezone accordingly

REMOVE ANY TIMEZONE FROM DATE AND TIME USING LARAVEL

                            REMOVE ANY TIMEZONE FROM DATE AND TIME STEP 1:- INSTALL CARBON DATE  Use the following command to install with composer. composer require nesbot/carbon Step 2:- Use this code $date = Carbon::parse('Thu, 28 May 2020 02:42:45 -0400'); dump($date->toDateTimeString()); dump($date->format('Y-m-d')); dump($date->format('Y-m-d H:i:s')); dump($date->timezone->getName()); dump($date->timestamp); output:-  Thu, 28 May 2020 02:42:45