muhamadhhassan.mePHP Attributes and MetaprogrammingIntroduction Attributes were introduced in PHP 8 around four years ago. As outlined in the RFC, attributes provide a structured and syntactic way to add metadata to declarations such as classes, properties, functions, methods, parameters, and constan...May 16, 2025·8 min read
muhamadhhassan.mePHP Generics in Laravel 11If you are a web applications builder with Laravel and happens to use PHPStan for static code analysis, you will start seeing new errors when you upgrade to Laravel 11.x. In a fresh Laravel install with PHPStan, the first time running ./vendor/bin/ph...Oct 22, 2024·6 min read
muhamadhhassan.meCreating Refresh Tokens with Laravel SanctumLaravel Sanctum is a lightweight authentication package for SPA applications and APIs. It was released in 2020 and became available out of the box since Laravel 8. Unlike JWT self-contained tokens, Sanctum uses a reference token. What is a Reference ...Jun 3, 2023·5 min read
muhamadhhassan.meUsing ULID in Laravel FrameworkIn a previous post, we talked about how ULID can be a better choice for primary keys in MySQL than UUIDs. In this tutorial, we will go over how to use ULID in Laravel Framework. ULID has been supported in Laravel since v9.30.1 and has received some i...May 20, 2023·2 min read
muhamadhhassan.meUsing Unique Identifiers as Primary Key in MySQLUnique identifiers are used to distinguish one object from another. They are commonly used to identify entities such as users, files, processes, network devices, and other objects. Unique identifiers are often implemented using a numerical or alphanu...Apr 30, 2023·5 min read