'datetime', ]; public static function record(int $userid, string $targetType, int $targetId, string $sourceType = '', int $sourceId = 0): self { return self::updateOrCreate( [ 'userid' => $userid, 'target_type' => $targetType, 'target_id' => $targetId, 'source_type' => $sourceType, 'source_id' => $sourceId, ], [ 'browsed_at' => Carbon::now(), ] ); } }