How to Save User's Last Login Time and IP Address
Quick tip of the day. Default Laravel Auth comes with User table and model, but without logging capability, so we need to build it ourselves. Fortunately, it's very easy, I will show you one method.
In-depth Laravel tutorials covering advanced topics, real-world examples, and best practices.
Quick tip of the day. Default Laravel Auth comes with User table and model, but without logging capability, so we need to build it ourselves. Fortunately, it's very easy, I will show you one method.
Quite often web-developers don't care enough about errors. If something goes wrong, you often see default Laravel texts like "Whoops, something went wrong" or, even worse, the exception code, which is not helpful at all to the visitor. So I decided to write a step-by-step article of how to handle errors in elegant way and present proper error information to the visitor.
Not sure if you've noticed, but Laravel 5.6 make:auth is generating Blade files with translation-ready texts, so instead of just "Login" you will see {{ __('Login') }}. How does it work and what's the reason?
While expanding my team and working with potential junior developers, I've come up with a few tasks to test their practical knowledge. There's not much value in quizzes or interviews - let them create one simple project. From start to finish. So here's an example of such project, you can use it for your own needs.
Laravel has a useful Notification system, where you can notify user about something via email, Slack etc. And there is a quite good default HTML template for emails. But what if you want to customize its design?
From time to time I see a need of restricting the access to a website by IP address, whether it's local network or a particular set of specific computers, like home/office. What's the best way to do that in Laravel?
We've just released a first "alpha" version of a package called ThemeDownloader - need your opinion, feedback and requests for future improvements. Basically, you can get a Bootstrap-based front-end theme into your Laravel project, just by launching one Artisan command.
If you stay too long on one form or get away from your computer, and then go back to fill it in - you may get a TokenMismatchException, because the CSRF token won't be the same. It kinda makes sense, but the problem I recently discovered that it does the same for logout (which is also a form). And that's pretty silly, so how to avoid it?
I find more and more Eloquent functions that are rarely used, so continue posting these short tips on the blog. Here's the next one.
Another year gone by, so it's time to to some recap - what articles were the best in 2017? Gathered this statistics from three sources where we publish content: this blog, QuickAdminPanel blog and our YouTube channel. Enjoy!