Dear friend, I suggest you create a table of logs
where you link by id
of the user to the activity performed by the user. Example:
Create a Model for the Logs table.
Create a Helper that you can call anywhere
Controller .
Creating default descriptions for each activity is a insert
update
among others ...
Example Model :
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class SystemLogs extends Model
{
}
Example Helper :
<?php
namespace App\Helpers;
class LogsHelper
{
public function saveLog($acivity){
...
}
}
Example Controller :
namespace App\Http\Controllers;
use Illuminate\Routing\Controller as BaseController;
use App\Helpers\LogsHelper;
class MyController extends BaseController
{
public function add(){
...
}
public function save(){
...
}
}
Of course I will not program for you, I'm just passing on a very simple user activity log idea. In this specific case you can save in the table of logs the name of the changed table, the id of the record created, changed or deleted linked to the id of the user. This is very useful in auditing.