Testing Your Laravel Middleware

While working on an application I wanted to test my middleware. When doing some investigation on this issue I didn't find any satisfying solutions, most involved manually creating a Symfony request object or mocking the request entirely.

Read more

Writing an Allowed Username Validator in Laravel

When building a project that requires top-level public user profiles, you will have to find a way to prevent the usernames from clashing with public URLs or files. If you don't do this, it's only a matter of time before someone signs up with the username 'logout' and make everyone who clicks on the profile link logout of their account. Here's a solution that I came up with that allows you to build it once and forget about it for the rest of the project lifetime.

Read more

Easy Bootstrap Forms in Laravel

When you are working with Bootstrap in Laravel, the extra div's that are required to format the form properly can really get in the way of the readability of your template. In this post we take a look at how to make it easier to manage your Bootstrap-based forms.

Read more