This week I attended LaraconEU 2017 along with the other members of Team Automotive from Gaspedaal.nl. It was our second year attending the conference, and we found it to be an informative look at the growing state of the Laravel ecosystem. Here are five things I took away from the event.
1. It's Getting Easier to Make Bots
Marcel Poicot kicked off the conference with an impressive display of the Botman platform. Botman makes it easier for PHP developers to make bots for external services like Facebook Messenger, Slack, and Telegram by distilling the 3rd party services into a simple API under the premise that all bots follow the same logical flow: ask a question, receive an answer, save some data, and ask another question.
As someone who has struggled in the past with the various access tokens, API calls, and webhooks necessary to create bots on various platforms, I was encouraged by the functionalities he displayed in the demo. Adding a new service to an existing bot was as simple as running an artisan command and adding the tokens to a configuration file. Very cool!
2. Use Laravel's Design Patterns
One of my favorite talks was by Bobby Bouwmann about using design patterns in Laravel. Using the basis of pizza making as an analogy for four different patterns, Bobby dove into factories, builders, strategies, and providers with aplomb.
His eloquent examples and simple pseudo-code really made it easy to understand the power of these constructs. As I become more familiar with Laravel, I am increasingly seeing opportunities to implement these reusable design patterns instead of coding something from scratch.
3. Have an incident Response Plan
Eryn O'Neil kicked off day two with a presentation about project triage. Using examples from her work in a consultancy, she brought to light two main points that no other talk at the conference came remotely close to touching. First, that software is about people first and that we should never underestimate how important empathy can be in better understanding clients and stakeholders.
Second, Eryn implored us to set up a detailed yet flexible incident response plan for what to do when a major error or outage occurs. With direct experience of how people react when something serious is going wrong, I couldn't have agreed more with her ideas. In this situation when having a clear head is vital, many people subconsciously freak out and end up making stupid mistakes. Having a checklist to know exactly the steps to take when a specific problem occurs can go a long way in saving time, money, and sanity.
4. Resources in Laravel
Taylor Otwell, creator of Laravel, delivered the talk's keynote address. His live demo of some of Laravel 5.5's new features was impressive in both its scope and clarity. The one aspect I found most useful was the concept of resources.
As opposed to the current state of pulling in data, formatting a model, and returning it within an API (something I personally do today), Taylor has made it deadly simple to just return a model instance via JSON.
Impressively, Taylor has made it incredibly simple to format dates, provide additional meta-data within the API response, and even do in-line if statements within an array. Truly awesome!
5. Testing Tips
As a testing evangelist on our team, I was happy to hear about some new testing tips from Amo Chohan. His talk was targeted towards streamlining your testing flow and easily implementing Test-Driven Development into the coding workflow. Although his talk covered a wide range of topics, the one thing I want to highlight was the use of Live Templates within PHPStorm or IntelliJ.
You can assign a live template to stub out some code that you always write, making it easier to bootstrap a new testing method, for example. Check out the GIF below for an example of how I implemented this. Thanks for the tips Amo!