Advanced Laravel: 14 Topics and Links to Learn Them
Quite often I get a question from junior developers like “how to get better at Laravel”, and there’s so much to study potentially that I decided to gather the topics and classify them somehow. Let’s begin.
Topic 1. Sending emails and notifications
It seems like a topic for basic Laravel developer, but while it’s easy to send emails, but the whole system of various notifications is much deeper, and worth studying. Sub-topics:
Sending Laravel notifications (not only email, but also Slack, SMS etc);
Email templates – customization, Markdown messages;
Putting emails into queue (more on that later);
Using external services to send emails – Mailgun, Mailchimp etc.
Topic 2. Queues and Jobs
Modern web-applications are much more than just browser-based synchronous page rendering, a lot of stuff is happening in the background on the server, while user may not even be online. So queues are getting more and more vital to learn. Also, there are a few tools related to the queues mechanism.
Sub-topics and links:
Laravel Queues and Jobs official documentation;
Laravel Horizon – dashboard to monitor queues;
Redis – most popular driver to use for queues (you need to be able to install and configure it);
Jobs, Queues and Scheduling Tasks – my video from the course “How to Structure Laravel Project”;
Demystifying Laravel Queues – article on Dev.to.
Side note: Jobs may be not queue-able and just run whenever you ask them, maybe even in sync mode, but it may be a good practice to structure your project code into Jobs, for clarity.
Topic 3. Advanced Eloquent and DB Operations
Eloquent is a great Laravel mechanism to deal with the database, but there’s so many less-known functions under the hood, like: Observers, Accessors/Mutators, Seeding, “magic methods” like firstOrCreate(), Collections etc.
Sub-topics and links:
Eloquent: Expert Level – my course on the topic;
Eloquent Relationships: The Ultimate Guide;
Model Observers – official documentation;
Accessors and Mutators – official documentation;
Collection Essentials – video from Laracasts.
Topic 4. Advanced Error/Exception Managing and Preventing
Bugs happen everyday, and that’s normal. But you can do a lot of things to prevent them or help the team to fix them easier. Using try-catch blocks, creating exceptions, configuring logging parameters, using tools like Bugsnag/Rollbar/Sentry, sending bug notifications to Slack/email etc.
Sub-topics and links:
Laravel Exceptions: How to Catch, Handle and Create Your Own;
Laravel API Errors and Exceptions: How to Return Responses;
PHP Try Catch: Basics & Advanced PHP Exception Handling Tutorial;
Laravel Error Handling – official documentation.
Topic 5. Creating Artisan Commands
We all probably use commands like “php artisan migrate” or “php artisan make:model“, but it’s often useful to create your own command, and potentially put it as a job into queue (see Topic 2 above).
Sub-topics and links:
Writing Artisan Commands – official documentation;
List of 16 artisan make:XXXX Commands with Parameters;
Writing Custom Laravel Artisan Commands – article from Laravel News.
Topic 6. APIs: Resources, Auth and Passport
This one is pretty huge – the whole world is going API, and you need to learn it. A while ago I would recommend learning Lumen, but now it lost popularity and performance advantage over main Laravel.
Sub-topics and links:
Eloquent: API Resources – official documentation;
Laravel API Tutorial: How to Build and Test a RESTful API – article from Toptal;
Build a REST API with Laravel API resources – article from Pusher;
Laravel API Authentication – official documentation;
Laravel Passport – official documentation;
Laravel API Errors and Exceptions: How to Return Responses.
Topic 7. Events and Listeners
Small topic, representing one of the design patterns in Laravel. You can fire an event, and have a separate class “listening” for when it happens.
Sub-topics and links:
Laravel Events – official documentation;
Custom Events in Laravel – article from TutsPlus.
Topic 8. Payments and Cashier
If you work on any serious project, probably some kind of payment will be involved. There are various payment methods/gateways, depending on the world region you’re in, but I would recommend to learn handling Stripe anyway, even if you don’t use it in production.
Sub-topics and links:
Stripe Payments in Laravel: The Ultimate Guide;
PayPal payments in Laravel: The Ultimate Guide;
Laravel Cashier – official documentation;
Laravel Cashier (Braintree) – official documentation.
Topic 9. Automated Testing, TDD and Dusk
This is a hot topic, with constant debates around it. Should we do unit testing? Should we do TDD? (test-driven development) What kind of tests do we write? How to make them run smoothly?
My personal take is that you have to have some automated tests, for the crucial parts of your application – especially related to money transactions, or main authentication. Basically, test everything that would make you lose your job, if it fails. Testing everything else – not a priority.
Sub-topics and links:
Laravel Testing: Getting Started – official documentation;
Test-Driven Laravel – awesome course by Adam Wathan, highly recommended;
Laravel Dusk – official documentation;
Build A Laravel App With TDD – Laracasts Series;
How to build a Laravel REST API with Test-Driven Development – article from freeCodeCamp;
Simple TDD in Laravel with 11 steps – article from Medium.
Topic 10. Deployment to Servers and Continuous Integration
Related to the previous topic – part of the deployment of your features, you should run your automated tests on some kind of staging server, and ideally set it up to run automatically.
Some of this knowledge isn’t specific to Laravel – you need to know how to set up and configure a new server (or use tools for it), how to do git branching and how to push your code correctly (especially if you work in a team), how to do zero-time deployment, rollback if something happens etc.
Sub-topics and links:
Laravel Deployment – official documentation;
How to Deploy Laravel Projects to Live Server: The Ultimate Guide;
Laravel Forge – tool to create/provision new servers for Laravel in minutes (and see my video DEMO: New Server and Deployment with Laravel Forge);
Envoyer.io – zero-time PHP deployment, official tool by Laravel (again, my video – How to Deploy Laravel Project with Envoyer);
Laravel Continuous Deployment With CircleCI and Deployer.
Topic 11. Package Development
At some point you grow a few projects that may require the same functionality, so it makes sense to turn it into a package, and maybe release it as open-source.
Sub-topics and links:
PHP Package Development – course by Marcel Pociot;
Laravel Package Development – video course on YouTube;
Package Development – official documentation.
Topic 12. Laravel Scout Search and Algolia
If you’re dealing with text-based search in a big database (like products in e-shop), you would definitely use a search mechanism like Laravel Scout. There are multiple drivers for it, I personally use Algolia and their free plan is more than sufficient for small projects.
Sub-topics and links:
Laravel Scout – official documentation;
Getting started with Laravel Scout and Vue Instant Search – article from Algolia;
Laravel Scout Algolia Search Tutorial With Example.
Topic 13. Socialite and OAuth
If you’ve ever seen a button “Login with Facebook” or “Sign in with Google”, it is usually powered by OAuth protocol, and its implementation tool in Laravel is called Socialite. Pretty easy to install and configure, and valuable to learn.
Sub-topics and links:
Laravel Socialite – official documentation;
From Google+ API to Google Sign In with Laravel Socialite;
Add Facebook, Twitter, and GitHub Login To Laravel with Socialite.
Topic 14. Vue.js
This may sound controversial, but these days it’s almost a must to be able to at least understand how front-end coding works. Of course, every employer is looking for a full-stack developer, but my personal opinion is that most of us are back-enders with some front-end knowledge, or vice versa, you can’t be good at both.
That said, you need to be able to construct a basic Vue.js structure to work with your Laravel API, also taking care of authentication and error handling.
Of course, you may choose other framework like Angular or React, but it seems that Vue is the most “Laravel-friendly” and supported by community, with articles and tutorials.
Sub-topics and links:
Laravel – JavaScript & CSS Scaffolding – official documentation;
The Ultimate Vue.js & Laravel CRUD Tutorial;
Quick Start with Laravel 5.5 + Vue.js: Simple CRUD Project;
Learn Vue 2: Step By Step – course from Laracasts.
So, this is my list. There are much more things to learn, outside of these topics, and with every new project you will bump into something you need to google/stackoverflow. And that’s ok. Especially these days, things are always evolving with enormous pace, so even if you master it all now, you may have to re-learn in a few years.
Anything I’ve missed here? Anything you would advise to study, to become an Advanced Laravel master?
0 comments:
Post a Comment
Thanks