Laravel Nova: User Login Log

Kuncoro Wicaksono
2 min readJun 10, 2020

--

Hello everyone, now i will share a tutorial to create user logged in log in Laravel Nova. Let’s check this out.

Photo by Joshua Aragon on Unsplash

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:

  1. Extend Laravel Nova LoginController
    You need to open your NovaServiceProvider. This means that you will use your own NovaLoginController.
App\Providers\NovaServiceProvider.php
Extend Laravel Nova LoginController

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.

Create User Log After Logged In Into Laravel Nova

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.

--

--

Kuncoro Wicaksono
Kuncoro Wicaksono

Written by Kuncoro Wicaksono

Building Digital Logistics Service | Tech Lead at GotSurge.co

No responses yet