author

Enforcing Strict Mode in Eloquent Models with Model::shouldBeStrict() in Laravel

In Laravel, Eloquent models offer a convenient way to interact with databases. However, by default, they allow a certain level of flexibility that could sometimes lead to hidden issues. One way to improve debugging and maintain strict coding standards is by enabling strict mode on Eloquent models. This is where Model::shouldBeStrict() comes into play. What […]

Share To:

Create unique slug without any package in laravel

In this article, I will demonstrate the process of dynamically generating unique slugs for any models within Laravel 10. Our approach involves crafting distinctive slugs for tables existing within our Laravel application. By crafting a unified helper method and strategically invoking it, we can seamlessly generate these unique slugs. By establishing a solitary helper method […]

Share To:

Object destructuring in JavaScript

In JavaScript, object destructuring is a convenient feature that allows you to extract properties from objects and assign them to variables in a more concise and readable way In the above syntax, property1, property2, etc. are the names of the properties you want to extract from the object. The {} curly braces indicate that we […]

Share To:

Array destructuring is cool

Array destructuring is a feature in PHP that allows you to easily extract values from arrays and assign them to variables in a concise and expressive way. Instead of manually accessing individual elements of an array using their respective keys, you can directly “destructure” the array into separate variables that hold the values you need. […]

Share To: