Laravel, PHP, Programming, Testing
Scenario Our form is expecting user input from a specific field is typed in all capital letters so we have a custom validation rule to check if the input is uppercase. Writing tests for a custom Laravel validation rule is ...
PHP, Programming
It’s possible to type hint an array (sort of) in PHP without using a Doc block. Version 5.6 added a splat operator or sometimes called argument unpacking. A splat operator is 3 dots before a parameter. The splat operator allows ...
First, why we might transform data? If we have raw data from a database and need to send data to an external system or maybe export data. In either case we most likely don’t want to expose database column names ...
Binding an interface to an implementation promotes good coding practices. As a result the code is less coupled, more maintainable, and testable. Why might someone want to bind an interface using Laravel? To put an abstraction between the application and ...
Something I ran into a while back while writing tests. If intentionally testing code for an exception then it is required to add an annotation above the test method.
Laravel 4 is capable of running on a shared hosting environment. It’s a lot easier than you probably think. Login to your host and go to your home directory. This does not mean your public home directory, they are separate. ...
For some reason my server started displaying code instead of actually processing or rendering the code. After playing around with the server I noticed the php5 module was missing from Apache. If your code is displaying and not rendering you ...
If you find that your mod rewrite is enabled, but doesn’t seem to be working you may need to add this little bit of code to your httpd.conf file. AllowOverride All It’s possible your file might have the following: AllowOverride ...
After upgrading my xampp installation I had issues sending email. I wrote a small test PHP page and it was saying my emails were being sent, but I never received them. Obviously something was misconfigured. I thought I correctly edited ...