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 | | 4898 Viewer | Category : Laravel

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 | | 5168 Viewer | Category : PHP

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 | | 856 Viewer | Category : PHP

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 | | 2305 Viewer | Category : Laravel

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=""></script> </head> <body> <div cl.....

By Hardik Savani | February 11, 2016 | | 2594 Viewer | Category : PHP HTML jQuery

Custom Cordova GuzzleHttp Algolia Package WHERE Query Sublime text 2 Fullcalendar JS Protection phpword Module After Ckeditor Bootstrap Plugin php.ini File Migration View Current Mysql Concat phpmyadmin GET Ajax File Upload Draggable Sortable virtual host Accordion groupBy() Sublime text 3 Homepage User Agent Request X-editable Plugin Rewrite Key Strip Tags Subscription Remember me DATEDIFF() Site Jquery Plugin Key Constraint Authentication Collapse Dialog box Percentage Import Send Cross Executed Server length upload_max_filesize Library Bootbox.js Determine Middleware Bootstrap Star Rating Plugin Carbon Blade inject Numeric KCFinder Remove softDeletes Chart.js QR Code Attribute Redirect Form Validation Old Append Terminal Failed Last FILTER_VALIDATE_URL Sitemap Bootstrap Tokenfield Plugin node.js Stripe public_path nl2br throttle split Bitbucket Hard Effect Bootstrap show password Plugin Clear JSON Image Gallery daterangepicker Particular Application Null Column execute query Facebook API Highlight JS Apache Animate Sub-Domain getQueryLog Update Ajax Request CloudConvert API response() PostgreSQL Snippet Strings encrypter basename() Sendgrid Message Ubuntu Attr Progress Bar Segment Switchery JS Paypal Payment Gateway jquery.lazyload.js array_change_key_case COUNT() socket Excel Jquery Dialog Box Typeahead JS whitespace sven/artisan-view package php_ini_loaded_file intervention/image Div dompdf Thumbnails Captcha code Empty ajaxComplete Laravel Builder Jquery Modal Demo Barcode roumen/feed package XSS php artisan serve google recaptcha code is_null Select RSS Schema Login With FB Parsley Datetimepicker