Laravel Nova: User Login Log
Hello everyone, now i will share a tutorial to create user logged in log in Laravel Nova. Let’s check this out.
Introduction
What Is Laravel Nova
Laravel Nova is a beautifully designed administration panel for Laravel. Nova is installed via Composer as a Laravel package. Primary feature of Nova is the ability to create, read, update, and delete resources in your database.
Getting Started
Now i will give an example to set log right after any user logged in in laravel nova. First thing first, you need to extend the LoginController.php. Why we need to extend default LoginController? Since we need to do any update in our code, but not in nova repository it self.
Step by Step:
- Extend Laravel Nova LoginController
You need to open your NovaServiceProvider. This means that you will use your own NovaLoginController.
App\Providers\NovaServiceProvider.php
2. Create user log after logged in
For better approach, we can use package from bolechen & spatie. This package allow you to set your default log into table view. If you don’t need it, you can simply use default \Log::info() from laravel.
This tutorial show you the simplest example to extend login behaviour in Laravel Nova. Also, by extend LoginController from Nova you can redirect to your own page after logged in or do more stuff with Authentication in Laravel Nova.