Resolving middlewares statically from controllers in Laravel 9.x
October 29, 2022 — In Laravel, it’s possible to resolve middleware from controllers. For example, you can resolve a middleware from the controller’s constructor like so.
A blog on PHP, JavaScript, and more
October 29, 2022 — In Laravel, it’s possible to resolve middleware from controllers. For example, you can resolve a middleware from the controller’s constructor like so.
October 24, 2022 — The latest version of Laravel 9.x has just been released and it comes with a lot of new features and improvements. In this article, I’ll talk about one of the new features in Laravel 9.x which is the new alternative mailable syntax.
October 18, 2022 — The latest and greatest version of PHP, PHP 8.2 is going to be released soon and it’s going to bring a lot of new features and improvements. In this post, I’ll talk about one of the new features in PHP 8.2 which is the true
type.
October 11, 2022 — Here’s a little tip that I learned recently. It’s about destructuring an object and aliasing the destructured variables. I’ll show you how it works with an example.
October 9, 2022 — Today, if we want to validate a JSON string in PHP, we can use the json_decode()
function. Here’s how it works.
October 4, 2022 — If you’re a developer, you must be familiar with the concept of version control. It’s a system that records changes to a file or set of files over time so that you can recall specific versions later.
September 30, 2022 — The use of environment files in Laravel (or any other similar framework) is pretty common. You can use the .env
file to store the environment variables. This is a great way to store sensitive information like API keys, database credentials, etc. in a secure way.
September 28, 2022 — It wouldn’t sound too obvious but sometimes your function might need to return multiple values. For instance, in one of the applications I’m working on, I have a JavaScript function where I have to calculate two different values and return them.
September 21, 2022 — I recently wrote an article on how to conditionally spread objects in JavaScript. In that article, I mentioned that the spread operator (...
) can be used to spread the properties of an object.
September 18, 2022 — Recently, I stumbled upon a problem where I had to toggle the state of the checkbox based on the viewport width. So, let’s say, if the viewport width is changed and is less than 879px
and the checkbox is checked, then it should be unchecked.