You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to see if the log 'update' add to the activity_log table with my controller, but it's not working. Meanwhile the log 'create' is working fine. Can you guys help me? Thanks
Model :
use Spatie\Activitylog\Traits\LogsActivity;
use Spatie\Activitylog\LogOptions;
class Dokumentasi extends Model
{
use HasFactory;
use LogsActivity;
protected $table = 't_dokumentasi';
protected $guarded = [];
protected $with = ['service', 'business', 'groupservice', 'status', 'platform'];
protected $fillable = [
'layanan_id',
'bisnis_id',
'gruplayanan_id',
'status_id',
'platform_id',
'lampiran',
'tanggal',
'nomor',
'perihal',
'deskripsi'
];
protected static $logFillable = true;
protected static $logUnguarded = true;
public function service(){
return $this->belongsTo(Service::class, 'layanan_id');
}
public function business(){
return $this->belongsTo(Business::class, 'bisnis_id');
}
public function groupservice(){
return $this->belongsTo(GroupService::class, 'gruplayanan_id');
}
public function status(){
return $this->belongsTo(Status::class, 'status_id');
}
public function platform(){
return $this->belongsTo(Platform::class, 'platform_id');
}
public function getActivitylogOptions(): LogOptions
{
return LogOptions::defaults()
->logOnly(['layanan_id',
'bisnis_id',
'gruplayanan_id',
'status_id',
'platform_id',
'lampiran',
'tanggal',
'nomor',
'perihal',
'deskripsi']);
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to see if the log 'update' add to the activity_log table with my controller, but it's not working. Meanwhile the log 'create' is working fine. Can you guys help me? Thanks
Model :
Controller :
*I'm using Laravel 9x and PHP 8x and spatie-activity-log v4
Beta Was this translation helpful? Give feedback.
All reactions