Now that we know how to create tests, it’s time we looked at how we can use factories to generate test data quickly and easily.
Read MoreWe’ve started a new mailing list to communicate new content and links to the community. You can sign up using the form below. We don’t like having our inbox filled up with SPAM so you can be assured that we won’t be sending you any. 😆
The PHP CLI has a cool feature (-l
) that allows you to check a file to see if it has any syntax errors:
The downside to this is that it doesn’t work on a whole directory. So unless you’re willing to add every new file to a script it’s not a quick way to check all your files before deployment.
With some command line magic we can have it run on all the PHP files in our application:
I find it helpful to run my template files through this process as well:
I’ve had trouble knowing what to put in my migrations’ up()
and down()
functions. The Laravel Docs include a lot of information but I wanted a quick reference guide for myself to convert Laravel migrations to MySQL commands because that’s what I’m used to. :-)
I also spend some time compiling this into a Cheetsheet if you want a printable version of this post.
Read MoreHappy 2020 everyone! As we normally try to do this time of year it’s time take a little retrospective on what’s been done over the last year and what we want to accomplish in the coming year.
Read MoreWelcome to the new layout for thisprogrammingthing.com! This redesign has been on our minds for a while now and it’s great to be able to finally get it out to everyone!
For the last several months, I’ve been using Visual Studio Code for all my PHP projects. I started using Better PHPUnit to run my unit tests because it has a quick keyboard shortcut to run a specific unit test from inside Code. I just set Better PHPUnit up on a new computer I forgot a couple of hoops I had to jump through in order to get it to run inside my Vagrant VM. This post is documentation so I won’t forget and that will hopefully help someone else.
Read Moresubscribe via RSS