Blog

Insights, tutorials, and thoughts on web development and technology.

Cache laravel query results using file driver for ajax

Cache laravel query results using file driver for ajax

Often in your laravel application you are loading and fetching the results on the database which doesn't necessarily needs to be fetched on every page reload. Query that takes longer amount to execute...

Nov 29, 2021 · Tushar
Add Select 2 package in Laravel using npm

Add Select 2 package in Laravel using npm

There are two ways to include Select2 plugin in your laravel project, one is via including the CDN and another is via NPM i.e. node package manager. I find handling the dependencies via NPM to be a...

Oct 26, 2021 · Tushar
Validate optional fields in Laravel

Validate optional fields in Laravel

At times in your laravel validation, you may want input field to be validated only if the user filled in the field and you may want to skip the validation if there is field is left blank. This can be...

Sep 03, 2021 · Tushar
Tomorrow and Yesterday date using Carbon in PHP Laravel

Tomorrow and Yesterday date using Carbon in PHP Laravel

Using Carbon library it is very simple to get yesterday's and tomorrow's timestamp in your PHP or Laravel code. You just need to import the Carbon library and call below functions Carbon::to...

Aug 30, 2021 · Tushar
Divide div in two columns using Tailwindcss

Divide div in two columns using Tailwindcss

Simple post to demonstrate how you can divide your container, page or a div into two columns / parts using TailwindCSS. Make your div into grid and use grid-col-2 to divide it into two parts....

Aug 26, 2021 · Tushar
Laravel upload file with original file name.

Laravel upload file with original file name.

When using laravel filesystem to upload files it automatically assigns a filename to the file. If you want to use the original filename or specify any other file name, you can do so by using storeAs m...

Aug 20, 2021 · Tushar
Cursor Pointer and other classes for Bootstrap 5

Cursor Pointer and other classes for Bootstrap 5

By default, Bootstrap 5 does not include classes for the CSS cursor properties. Here is how you can quickly add these properties which is similar to tailwindcss in your Bootstrap 5 library. @import "...

May 22, 2021 · Tushar