Harrisonm

Preview an image before it is uploaded

I want to be able to preview a file (image) before it is uploaded. The preview action should be executed all in the browser without using Ajax to upload the image. [crayon-5a16fcd8a30ed036970015/] and the associated HTML: [crayon-5a16fcd8a30f6959633857/] The FileReader object lets web applications asynchronously read the contents of files (or...Read more …
Harrisonm

How to store all records in laravel Cache

You can easily save database record in cache and easily you can get that record from cache in Laravel. Cache is knows as persistence layer between database and application and it is used to improve website performance because sometime database query is going very slow due to lots of traffic...Read more …
Harrisonm

How to get last executed mysql query in laravel 5

Sometime while working with laravel framework you need to see last executed query for debugging . You can use DB::getQueryLog() function to get all executed queries if you want to get last executed then use end()method. Before getting query log you need to first enable it by using DB::enableQueryLog() function...Read more …
Harrisonm

Upload & Resize Image in Laravel

If you want to add image field in exiting form or any other for then follow the steps :- You will need to add below code in controller : Path : resources/themes/default/views/pages/category.blade.php Add your field in blade file :- [crayon-5a16fcd8a3f9f161182387/]    Path :- app/Http/Controllers 1). use Intervention\Image\Facades\Image; in header 2). Add...Read more …
Harrisonm

Customizing pagination templates with example

First you need to create a table with some dummy data to test this code. Step 1: Table and Model I have created a Product table(fields : name, details) in our database with some data. Now create a model corresponding to the table: app/Product.php [crayon-5a16fcd8a42ff124987451/] Step2: Add route In this step,...Read more …