Tag: php

How to use PHP __call() Magic Method?

The PHP `__call()` magic method is an incredibly powerful tool for dynamic method handling and custom object behaviors.

Understanding Autoload and Namespace in PHP

If you come across from procedural PHP programming, __autoload__ and __namespace__ kind of confusing naming for you. To make it easier, today, I will take a deep dive into understanding autoload and namespace in PHP.

Clean Architecture in PHP | Part 1

Suddenly I feel to improve my knowledge about Clean architecture in PHP. As of, I started reading some books, tutorials, and screencasts. There are lots of content around the internet. I plan to write my extractions that I have learned from those sources. Hopefully, it will be helpful for you. Today, I will share in what context clean PHP architecture is suitable for your project.

How to reduce condition from Model | Write Clean Code - Part 2

In this series to tutorials, my plan is to take some real-life code and try to refactor the code as much as I can. Today, I will show you how to reduce unnecessary condition from the Laravel Model.

Reduce If else in PHP | Write Clean Code - Part 1

Unfortunately, there is no unique way to write code. Although there are some set of rules of writing code, however, programmers are free to write code in their own style, especially the logical part. We often see the code that contains a lot of `if-else` statement, even __nested if-else__.

Laravel Check If Relationship has Loaded or Not

Now, sometimes if you need to check whether the model has loaded the eager loading or not, then you need to check with `relationLoaded()`. Here is how you check this-

PHP Fatal error - Declaration of Tests\TestCase::setUp() must be compatible

If you are suddenly facing the issue on Laravel testing that, **PHP Fatal error Declaration of Tests\TestCase::setUp() must be compatible with Illuminate\Foundation\Testing\TestCase::setUp():....** in that case, this post might be helpful for you.

Macbook Update PHP Version Globally

If you are using MacBook and you want to update your current PHP version, it might be troublesome for you in some cases.

Laravel Testing - How to do Login PHP UnitTest

Today, I will show you how to do Login PHP UnitTest with Laravel. This article will cover the login testing part only.

How to use php array_sum() function?

Today, I will show you the purpose of `array_sum()` and a practical uses of it.

Writing your first PHP Unit Test | Learning PHPUnit - Part 2

Writing your first PHP Unit Test | Learning PHPUnit - Part 2

Learning PHPUnit | Part 1

Learning PHPUnit | Part 1

How to Upgrade PHP Version on mac

How to Upgrade PHP Version on mac

How do we rewrite Sclrship?

How do we rewrite Sclrship?

Laravel use PUT or PATCH in Postman

Laravel use PUT or PATCH in Postman

How to add extra values in Laravel Request

How to add extra values in Laravel Request

How to use Slug in Laravel Factory

How to use Slug in Laravel Factory

Building a delighted RESTful API with Laravel

Building a delighted RESTful API with Laravel

An Introduction to Laravel Policy

An Introduction to Laravel Policy

Deep Diving into Laravel Sub-query

Deep Diving into Laravel Sub-query