How did you discover Laravel?
In 2016 I was involved in a web app project that had 3 distinctive requirements:
- To build full-blown PHP based API system
- To build a “user facing” web app (PHP/JavaScript) driven by that API
- To expose the API to the world
As I usually did at that time, I started by creating two separate PHP apps, one for the API and the other for the “front” app. Around 30% into the coding, I realised that I was headed at high-speed into a terrible mess, and that the results code would be hell to maintain, considering that it was only me involved in the development.
I started to look for another approach, or possibly a framework built on the work of other (and hopefully wiser) developers. After looking into a few options, I settled on Laravel.
I quickly discovered that I could meet all of the project requirements (i.e. creating the API and the web app) together in the same Laravel instance.
This was the first time I had built a real-world Laravel app, and it worked tremendously well, which really felt quite amazing. On top of that I was completely blown away by the awesome documentation and other online resources, which meant I hardly ever felt stuck during development.
What do you like about Laravel?
I love the ease and speed of creating web applications with Laravel, as well as the internal logic, simplicity and robustness of the framework itself.
Most of the parts of a web application – Authentication, Routing, DB management, Event system, Templating – are already built into the framework itself. As the developer it’s up to you to adapt them to the business logic of the application you’re building.
The security features of Laravel are so well integrated into the core concept Laravel that it is actually very difficult to develop with security flaws!
For example:
- You never use the PHP’s superglobals
($_GET, $_POST)
to retrieve the request data. If you do things the Laravel way, you use the Request class, which handles all of the data validation and sanitisation right out of the box. - To make a form functional you have to explicitly include the Cross Site Request Forgery token in the form.
- If you use the database abstraction layer (Eloquent ORM) for your database queries, you are automatically protected against an SQL injection, mass database assignments etc.
What sort of developer are you?
Extremely eclectic!
I’ve always worked with a broad range of web technologies, frameworks, CMS-es, languages and libraries. I still cannot say for sure what type of a developer I am, back-end or front-end, left-end or right-end. Or no-end 🙂
Maybe the latest “Fullstack developer” buzzword is as close to what I do throughout the day. On the other hand, I really don’t know what “Fullstack” really means.
Can you name a couple of memorable Laravel projects?
Project 1: Website migration/publishing tool
I was assigned the complex task of building a PHP based system able to migrate websites from production to staging and vice-versa (and a hundred of smaller things in between).
At first I considered building it with a raw PHP approach, using no framework whatsoever, but quickly I recognised the risk of this becoming one of those “never-ending” projects, given the very extensive requirements.
Instead I switched to Laravel, and together with the Bulma CSS framework as well as a Vue.js framework (trio fantastico at those times!) it took me less than a month to deliver a working alpha version of the app.
I still remember my colleagues’ faces when I started moving sites between servers like a boss 🙂
Project 2. Real-time bidding platform
I was given the task of building a full-featured Real-Estate bidding platform for one of our clients. The data had to be retrieved from a remote API, and the user side of the app had to include a multi-user and user permissions features.
This was the first time I was using the “Laravel Websockets” package, as well as “Inertia.js”. These two libraries – combined with Bulma CSS and Vue.js – was all I needed to build a “desktop-like” single page app, which was tremendously fast, responsive and easy to use.
The Websockets package helped me realise most of the important aspects of the site: The bidding ticker, real-time bids and the real-time chat system.
Once again, Laravel proved itself to be a very stable framework while remaining sufficiently flexible to be used for all kinds of projects.
What do you especially like about Laravel?
Development speed
It takes literally just a couple of hours to prototype an app, with all of the layers necessary, like: routes, templates, models, controllers etc.
Artisan – Laravel’s command line tool
Especially Artisan’s “thinker” tool, which lets you quickly test your code, or write and run arbitrary PHP.
Having fun while developing
The inner structure of the framework, as well as the terminology used throughout it, really makes you feel like you are communicating with the framework 🙂
Any funny anecdotes about working with Laravel?
The almighty Laravel caching. On multiple occasions I found myself close to a nervous breakdown after implementing a perfect bugfix or feature, and then forgetting to clear the cache. Oh, and the 419 error! I tend to always forget to include the @csrf blade tag in my forms!
Zoran, Senior Developer & Lover of Laravel