Detect user is Online or Offline using Livewire in Laravel

If you are using Livewire then you don’t need to include any external library or write a script to detect if a user is online or offline.

Livewire already provided a utility to perform offline action check. You only need to add it to the HTML element that gets affected according to the user state.

In this tutorial, I show how you can detect if the user is online or offline and display an alert using Livewire in Laravel 9.

Detect user is online or offline using Livewire in Laravel

Read more

How to Prefetch data on Mouseover in Livewire – Laravel 9

In Livewire you can prefetch the data from the database before the user click on the HTML element. Data will show instantly on click if it is already loaded.

For this, you have to add prefetch modifier to the event.

In this tutorial, I show how you can preload content when the mouse over on an element in the Livewire component in Laravel 9 project.

How to Prefetch data on mouseover in Livewire - Laravel

Read more

How to Upload and Store file to MySQL database – Laravel 9

Storing files in a  database makes managing large amounts of data easier, particularly if they are interrelated with a record. For example – A profile picture or documents of a user, product images, etc.

In this tutorial, I show how you can upload and store file to the MySQL database in the Laravel 9 project and also show how you can retrieve them.

How to upload and store file to MySQL database - Laravel

Read more