I'm using SPATIE laravel-activitylog I followed all the instructions but still it only log the Create function not update while using it on a Modal
My Modal
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Spatie\Activitylog\Traits\LogsActivity;
class Contact extends Model
{
use HasFactory, LogsActivity;
protected $fillable = [
'comp_name',
'cont_name',
'cont_email',
'cont_number',
'created_by',
'updated_by',
];
// spatie activitylog
protected static $logFillable = true;
protected static $logOnlyDirty = true;
protected static $logName='users'; // default
}
My Controller
Contact::where('id',$input['id'])->update($data);
$retrnArray = array('status'=>1,'msg'=>'Updated Successfully');