Latest Post


How to get hours difference between two dates in laravel?

Whenever you need to get difference between two dates in hours in laravel 5 then you can get easily using Carbon. Laravel by default provide Carbon class. Carbon class throught you can calculate difference between two dates in hours. In Following example you can see, we have a two dates, first $to variable and second one $from variable. Carbon class diffInhours function using you can get difference between two dates. I hope you will find your solution. <strong>Example:</strong> <pre class="language-php"> $to = \Carbon\Carbon::createFromFormat('Y-m-d H:s:i', '2015-5-5 3:30:34'); $from = \Carb.....

By Hardik Savani | February 13, 2016 | | 6185 Viewer | Category : Laravel
READ MORE

How to add prefix in each key of PHP Array?

Whenever you require to add one character or more to each and every key of array then most of the people would like prefer add key using for loop or foreach loop. But we can do this without using any kind of loop. using array_combine(), array_keys() and array_map() through we can add prefix on each key of array, In Bellow example you can see how to use both function together and add faster way to add prefix of every item key: <strong>Example:</strong> <pre class="language-php"> $myArray = ['0'=>'Hi','1'=>'Hello','2'=>'Hey']; $myNewArray = array_combine( array_map(function($key){ return 'a.....

By Hardik Savani | February 13, 2016 | | 6955 Viewer | Category : PHP
READ MORE

How to get minimum key value of array in PHP?

Sometimes, you need to get minimum key value of your array but you try to get with loop and any function etc, but in bellow example you can see we can get smallest key value from our php array by using min() and array_keys(). So, let's try to use in your code this way: <strong>Example:</strong> <pre class="language-php"> $myArray = ['2'=>'Hey','4'=>'Hello','1'=>'Hi','3'=>'GH']; $new_key = min(array_keys($myArray)); $new_val = $myArray[$new_key]; print_r($new_val); </pre>

By Hardik Savani | February 12, 2016 | | 1001 Viewer | Category : PHP
READ MORE

How to store all record in laravel5 Cache

if you are work with large application which depend on large query and required large number of record at that time your application performence littel bit down. that problem overcome with laravel Cache functionality. Laravel Cache provide to you store your large query in cache so your application performence improve. first of all you must write <stong>"use Cache"</strong> keyword on top of the your class Here is an example using Laravel’s Fluent Query Builder: <pre class="language-php"> $users = DB::table('order') ->orderBy('price', 'desc') ->take(10) ->.....

By Hardik Savani | February 11, 2016 | | 2642 Viewer | Category : Laravel
READ MORE

How to set scroll to bottom in jquery?

Sometimes, we need to set scroll bottom as default by using jquery, in bellow example you can see i use scrollHeight for get the total height of scroll class div with scroll, and at last i use animate with scrollTop attribute and set bottom, So Basically when your page will load then automatically scroll as bottom. <strong>Example:</strong> <pre class="code language-html"> <html lang="en"> <head> <title>Scroll Down bottom</title> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> </head> <body> <div cl.....

By Hardik Savani | February 11, 2016 | | 3615 Viewer | Category : PHP HTML jQuery
READ MORE


Element Dropbox API Notification Redirect inner join Location Numeric Inserted Id gulp bootstrap-progressbar.js ixudra/curl composer package Old Jquery Modal Data Backup API Attr Socket.io bootstrap tagsinput ACL Index Request Method Undefined Xampp FIND_IN_SET() Where Not In Query Magento 2 Twitter Bootstrap DATE_SUB Top Collapse Eloquent-Sluggable Package Multiple Javascript Capitalize Laravel Builder Sublime text 3 xoxco tags input Directory Foreign Key Special Enable Artisan Command Field Admin Panel Permission File Upload Laravel Factory SweetAlert Plugin Remote scrollTop Strings apache2 Tooltip CRUD Fullcalendar JS MassAssignmentException MySql Array Popup Box Barcode Technology Lavacharts HTML Controller Laravel 5.4 - Markdown Mailables Ubuntu 14.04 Convert guzzle http client ajaxStart basename() Laravel 5.5 MySQL Subquery FILTER_VALIDATE_URL Parsley Sortable Tag Manager plugin Bootstrap Plugin Composer Environment Switchery JS Event select box search Accordion Custom php.ini Sublime Packages Version Contact US Form refs bootstrap-multiselect plugin Ionic framework Ajax Custom Command Algolia Package Validation Flash Message php_ini_loaded_file Check Route Express softDeletes Autocomplete Cache virtual host ID Timepicker Mailchimp API Segment CSS New Features Log GET Ajax Progress Bar yajra/laravel-datatables-oracle RSS RAND() Homepage Socialite SMTP Ckeditor Foreach popupMultiSelect plugin Migration Components & Slots Magento Configuration Rewrite Connection Datepicker Branch Bootstrap show password Plugin Generate Laravel 5 Exists Folder Gravatar Image length asgardcms Snippet Laravel Passport Animate milon/barcode Clear Confirm Box Datetimepicker php artisan serve Bootbox.js REST