I was watching a talk by [Yaz Jallad](https://github.com/ninjaparade) about **I'd Like To Speak To Your Manager** on [Laravel Meetup](https://meetup.laravel.com/). He explained the manager pattern in a sublime way. I really love his explanation.
In this tutorial, I will show you how to implement the Open Closed Principle in Laravel for Sign up a user. Here my intention is to apply OCP on Sign up so that you can relate it to your real-life scenario.
Today, I am going to show you how to avoid inline code and logic in PHP.
In this post, we will learn how to implement the Open-Closed Principle in Laravel.
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.
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__.