Sometimes you want to ensure that a field is unique in the database so that someone can’t add the same item twice, such as the title for a post. Laravel provides a couple of handy tools for this, including the Unique validation rule, but there is a bit more configuration required to other validation rules to make the most of its abilities.
In my day to day job I make use of a lot of packages. This got me thinking it would be good to create a package of my own, so I have decided to build a Laravel package. It’s got a long way to go yet before it’s ready, but I thought I would write down my thoughts about the benefits of building a package while it is still fresh in my mind.
Developers love building things and sometimes we want to share these things with other developers to help make their life easier. Creating you project and putting it on GitHub can seem like the difficult part, but letting people know its there and getting them to use it can be even harder.
Like many people, I work in a city, but I live outside the city, meaning I have to commute to work each day. My normal commute takes me over an hour to commute just over 20 miles. That’s pretty shocking when you think of it. My average speed is less than 20 miles per hour. I enjoy my job but, like most people, I really don’t enjoy the commute to and from work.
The more time you spend reading the Laravel docs, the more things you will find that will save you time and effort. I have been using Laravel for many years but this week I discovered I had been using the many to many relationship in a sub optimal way, and by that I mean I avoided it at all costs.