July, 25, 2019 . 1 min read

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

Hello 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. Normally it happened because of PHP Unit 8 incompatibility issue. If you suddenly upg...

July, 24, 2019 . 2 min read

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. There are [many ways](http://laravel-school.com/posts/how-to-upgrade-php-version-on-mac-29) to update php version in mac, however, today I will show you how to update PHP version globally. Currently, I am using PHP 7.1 vers...

Macbook Update PHP Version Globally

July, 23, 2019 . 1 min read

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. **I assume that you have migrated laravel default database and create the respective model for that.** ### Create User Factory Firstly, let's create a user factory for login. You need to run the following command to creat...

Laravel Testing: How to do Login PHP UnitTest

July, 21, 2019 . 1 min read

How to use php array_sum() function?

In PHP, there is a built-in function called **[array_sum()](https://www.php.net/manual/en/function.array-sum.php)**. Normally **array_sum()** help to sum all the elements in an array. Today, I will show you the purpose of `array_sum()` and a practical uses of it. Consider the following code, that helps you to sum all the elements of an array....

How to use php array_sum() function?

July, 20, 2019 . 1 min read

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

Hello Today, I am going to show you writing your first PHP Unit Test. Keep it in your mind that, this series is for absolute beginner those don't use testing in their code. Let's start. ### Prerequisites - [Learning PHPUnit | Part 1](http://laravel-school.com/posts/learning-phpunit-part-1-31) ## Create your first PHP Unit Test Create...

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

July, 19, 2019 . 2 min read

Learning PHPUnit | Part 1

I was planning to write a few articles about **PHP Unit** for the beginner. Today, finally I got a chance to do that. In this series of article, I am going to show you how to use PHP Unit in PHP for the absolute beginner. In this consequence, today I am going to show you how to install PHP Unit with Composer. Let's dig into it- First, let's cr...

Learning PHPUnit | Part 1

July, 19, 2019 . 1 min read

Please make sure you have the correct access rights

If you are using git in your computer and facing the issue called **Please make sure you have the correct access rights and the repository exists.** then, this post might be helpful for you. To avoid this issue, you need to add `ssh` key in your git account. I consider you are using GitHub. So let's dig into it. 1. Copy the SSH Key In yo...

Please make sure you have the correct access rights

July, 16, 2019 . 1 min read

How to Upgrade PHP Version on mac

Hello Recently I was facing issue to upgrade PHP version 7.3 from 7.1. Well, there are many tutorials online, unfortunately, many of them have confusing instruction. However, I come out with the easiest way to upgrade the php version from 7.1 to 7.3. Upgrading PHP could have two possible ways, `curl` and `brew`. ## Curl If you...

How to Upgrade PHP Version on mac

July, 14, 2019 . 1 min read

Apply The Open Closed Principle in Laravel | Part 1

I think one of the most popular design principles is **Open Closed Principle** that most of the PHP developers use in their project. I am going to show you how to use the Open Closed Principle in Laravel. In order to write deeply, this article might have a few sections. Today, I am going to show you the first part. According to [Wikipedia](ht...

Apply The Open Closed Principle in Laravel | Part 1

July, 11, 2019 . 1 min read

How to use dump() on Laravel Collection

Hello Today, I am going to show you short tips on how to use `dump()` on Laravel collections instead of `dd()`. Sometimes, writing `dd()` is time-consuming since it a function. In that case, if you are working on Laravel Collections, using dump will be time-saving for you in the development stage. https://www.youtube.com/watch?v=k3C1g65FlK...

How to use dump() on Laravel Collection