Skip to content

Mohcin Bounouara

Thoughts about software engineering and life

Understanding Method Spoofing in Laravel

Title: Understanding Method Spoofing in Laravel When working with request/response methods, different HTTP methods like GET, POST, PUT, and PATCH have custom purposes. POST is generally used for creating resources, while PUT and PATCH are intended for updates. But as a developer, you’ll often see POST used for updates too. This happens due to browser Continue reading “Understanding Method Spoofing in Laravel”

Handling Multiple Forms with Different Field Names Using a Single Endpoint

The Problem: Suppose you have an endpoint to send data to the database, and in your project, you have two forms with the same field(s), let’s say a field named “name”. How can you manage this without creating redundant and complex code? The Initial Solution: A quick solution might be to create two separate forms Continue reading “Handling Multiple Forms with Different Field Names Using a Single Endpoint”

You can rely on existing solutions

I used to believe that building everything from scratch was the mark of a good developer. However, I understand later that this mindset reflects a lack of experience and problem-solving skills. In the real world, developers often rely on prebuilt solutions rather than creating everything themselves. While we might not always understand the inner workings Continue reading “You can rely on existing solutions”

A Quick Guide to Creating Laravel Factories and Seeders

I often find myself back to the Laravel documentation whenever I need to create new factories and seeders for my projects, whether they’re learning exercises, hobby projects, or real-world applications (bored doing the same actions every time). To make this process easy, I’ve decided to create a guide that I can refer to whenever needed, Continue reading “A Quick Guide to Creating Laravel Factories and Seeders”

Promises in life is likes promises in JavaScript

In JavaScript, a promise is like a promise someone made to bring you something. It works based on four main steps: creating a promise, waiting for the promise to happen, the promise being fulfilled (meaning they come with the thing you were waiting for), or the promise being broken (meaning they couldn’t come with that Continue reading “Promises in life is likes promises in JavaScript”

Code Reading is important!

One of the most important things I’ve focused on recently is reading a lot of code written by others. Even if I don’t understand some large parts of the code blocks I’m reading, it’s a way to train my brain muscles, boosting both my imagination and logic. By reading others’ code, you gain new perspectives Continue reading “Code Reading is important!”