Uploaded April 2019 | Updated December 2026, 14 minutes ago
☆☆ ABOUT THIS VIDEO ☆☆
Tired of looping through and entire array while debugging code? Well look no further, Conditional debugging will help you save a lot of time. By using PhpStorm and Xdebug, you will be able to apply conditions on when to break!
Reval Govender
LinkedIn: uk.linkedin.com/in/reval-govender-0ba14860
Twitter: twitter.com/RevalGovender
Scroll to Source Plugin:
plugins.jetbrains.com/plugin/7606-scroll-from-source
Laravel Tutorials:
youtube.com/playlist?list=PLrIm-p2rpV0FmbeNsYYh_4Fcb4Ibq29tJ
2 - 3 min Developer Quick Tips Series:
youtube.com/playlist?list=PLrIm-p2rpV0F6yyK99B9TU6yVhnPdzelB
PHP Developer Tutorials:
youtube.com/playlist?list=PLrIm-p2rpV0Fy93MCcC1Co0BuccJk6QqX
A Journey To TDD the tutorial series:
youtube.com/playlist?list=PLrIm-p2rpV0EWSkkE6Llxaw7sxnsxdVWB
☆☆ FOLLOW ME ONLINE ☆☆
LinkedIn: https://uk.linkedin.com/in/reval-gove...
Twitter: twitter.com/RevalGovender
☆☆ SPONSORSHIP ☆☆
Does your company want to sponsor a video? Contact me by twitter or LinkedIn
☆☆ ABOUT THIS VIDEO ☆☆
Tired of looping through and entire array while debugging code? Well look no further, Conditional debugging will help you save a lot of time. By using PhpStorm and Xdebug, you will be able to apply conditions on when to break!
Reval Govender
LinkedIn: uk.linkedin.com/in/reval-govender-0ba14860
Twitter: twitter.com/RevalGovender
Scroll to Source Plugin:
plugins.jetbrains.com/plugin/7606-scroll-from-source
Laravel Tutorials:
youtube.com/playlist?list=PLrIm-p2rpV0FmbeNsYYh_4Fcb4Ibq29tJ
2 - 3 min Developer Quick Tips Series:
youtube.com/playlist?list=PLrIm-p2rpV0F6yyK99B9TU6yVhnPdzelB
PHP Developer Tutorials:
youtube.com/playlist?list=PLrIm-p2rpV0Fy93MCcC1Co0BuccJk6QqX
A Journey To TDD the tutorial series:
youtube.com/playlist?list=PLrIm-p2rpV0EWSkkE6Llxaw7sxnsxdVWB
☆☆ FOLLOW ME ONLINE ☆☆
LinkedIn: https://uk.linkedin.com/in/reval-gove...
Twitter: twitter.com/RevalGovender
☆☆ SPONSORSHIP ☆☆
Does your company want to sponsor a video? Contact me by twitter or LinkedIn







![Part 17 - Slight refactor and clean up [How to use TDD to build a REST API in Laravel 6]
Let’s do some clean up. We updated most places in the code base to use the constants from the model, but we did not update everything. I noticed a few occurrences.
Let’s check our tests. You know, this is part of owning and maintaining a code base is. We might add something for the benefit of the code base but not go about it the right way. That’s not ideal, but in our scenario, we have tests to cover any changes we make. We also have time to maintain our codebase. So when we are refactoring, we must be confident our tests will catch our bugs.However, tests are only as good as you write them to be. So when you write a test, think about what you are testing and ask yourself: Does your test actually cover that scenario.
Check migration, factory, controller. After those changes, let’s run our test suite to make sure everything still works as expected. I can’t stress how important it is to keep doing this. Keep your code cycles small. Same with your commits. Let’s commit this work.
Another important lesson to learn is, don’t keep dead code in a database. You are much better off removing stuff you don’t need. Let’s start with this controller. We can remove the create() and edit() methods.
We can also get rid of our User model and we can also get rid our User factory. Run your test suite. As expected, everything passes.
Watch next video here:
https://youtu.be/ugy6MEeeVWI
Watch this course in full here:
https://www.youtube.com/playlist?list=PLrIm-p2rpV0F-rl4NPjNslEmW-D83AHOr
Laravel Tutorials:
https://www.youtube.com/playlist?list=PLrIm-p2rpV0FmbeNsYYh_4Fcb4Ibq29tJ
2 - 3 min Developer Quick Tips Series:
https://www.youtube.com/playlist?list=PLrIm-p2rpV0F6yyK99B9TU6yVhnPdzelBWatch this course in full here:
https://www.youtube.com/playlist?list=PLrIm-p2rpV0F-rl4NPjNslEmW-D83AHOr Part 17 - Slight refactor and clean up [How to use TDD to build a REST API in Laravel 6]](https://i.ytimg.com/vi/ngW5raXk6mA/mqdefault.jpg)


