Amit Merchant

Amit Merchant

A blog on PHP, JavaScript, and more

  • Articles
  • Projects
  • Uses
  • Art
  • About
  • Ctrl K
  • Search
Laravel PHP JavaScript Git React

Unpacking inside arrays using spread operator in PHP

May 12, 2020 — If you’ve ever worked with JavaScript, you might be well aware of this feature. So basically, from PHP 7.4, you would be able to unpack arrays into another array using spread operator [...].

Read More ⟶ ⋆ PHP

Detecting device color scheme automatically in JavaScript

May 11, 2020 — Implementing a Dark mode in applications is all the rage these days. And you can provide a toggle to switch between Dark/Light mode to users like the one I’ve implemented on my Notepad app.

Read More ⟶ ⋆ JavaScript

Using ::class static class keyword in PHP

May 8, 2020 — If you’ve worked with modern frameworks such as Laravel, you might have seen this keyword ::class be used extensively throughout the application.

Read More ⟶ ⋆ PHP

How to pull a composer package in a Laravel project locally

May 7, 2020 — Lately, if you’ve been working on some functionality and you want to extract it as a Laravel package, you’d like to first test it locally. And if everything is well and good, you’d then publish it to the packagist.org.

Read More ⟶ ⋆ Laravel

Select React element type using general expressions

May 6, 2020 — The usual way of using a React element is to first import it and then utilize it inside of an another React component like so.

Read More ⟶ ⋆ React

Null coalescing assignment operator in PHP

May 4, 2020 — When PHP 7.0 released, it has added many nice things in PHP’s toolbelt of utilities. One of the things among this was Null coalescing assignment operator (??).

Read More ⟶ ⋆ PHP

How to implement wrapper classes in PHP

May 4, 2020 — If you look at PHP’s core helper functions, they aren’t very intuitive to use and are pretty inconsistent at times. For instance, the array_map function is used to apply the callback to the elements of the given arrays. Here’s how its definition looks like.

Read More ⟶ ⋆ PHP

Using custom class as a Facade in Laravel

April 29, 2020 — Facades, in Laravel, is basically a way of using Laravel’s classes without injecting them into the constructor of the class in which you want to use them.

Read More ⟶ ⋆ Laravel

Create your own custom Blade directive in Laravel

April 27, 2020 — Laravel Blade comes with many in-built directives such as @section, @yield, @parent, @json and several others, all of which have a certain purpose attached to them.

Read More ⟶ ⋆ Laravel

Auto discovery of events in Laravel

April 26, 2020 — In this article, I’ve written about how to use event subscribers or observer pattern in Laravel.

Read More ⟶ ⋆ Laravel
« Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 Next »

Download my eBook

PHP 8 in a Nutshell

Newsletter

By subscribing, you agree with Revue’s Terms of Service and Privacy Policy.

Follow me everywhere

My Tiny YouTube Channel ⟶ YouTube Icon

Recently Published

  • Natural debouncing using the useDeferredValue hook in React 18 NEW

  • The global faker helper in Laravel 9.x

  • Do cleanup from useEffect in React.js whenever possible

  • Plural strings based on the count in Laravel

  • Detecting slow database operations in Laravel 9.x

Top Categories

Laravel PHP JavaScript Miscellaneous CSS React Git Jekyll VS Code ➔
Home About Contact Categories Guestbook
Previous page Next page
Amit Merchant
About Contact Categories Guestbook
Copyright © 2022 — Amit Merchant