formatting, juiste use voor UpdateDynamicRequest
linter / quality (push) Failing after 1m2s
tests / ci (8.3) (push) Failing after 48s
tests / ci (8.4) (push) Failing after 1m5s
tests / ci (8.5) (push) Failing after 1m5s

This commit is contained in:
Daan Meijer
2026-06-22 00:10:39 +02:00
parent 3e473de826
commit 10bd46a53e
56 changed files with 174 additions and 142 deletions
+9 -9
View File
@@ -2,16 +2,14 @@
namespace App\Services;
use App\Models\User;
use App\Models\Dynamic;
use App\Models\Ledger;
use App\Models\Mutation;
use App\Models\Message;
use App\Models\ReadCursor;
use Illuminate\Support\Carbon;
use Illuminate\Support\Str;
use App\Models\User;
use App\Notifications\NewActivityNotification;
use Carbon\CarbonInterface;
use Illuminate\Support\Carbon;
class ActivityService
{
@@ -35,7 +33,7 @@ class ActivityService
/**
* Get the read cursor timestamp for a user on a specific entity.
*/
public function getCursorReadAt(User $user, $entity): \Carbon\CarbonInterface
public function getCursorReadAt(User $user, $entity): CarbonInterface
{
$cursor = ReadCursor::where([
'user_id' => $user->id,
@@ -97,6 +95,7 @@ class ActivityService
$participants = $dynamic->participants()->withPivot('display_name')->get();
$participantsMap = $participants->reduce(function ($acc, $p) {
$acc[$p->id] = $p->pivot->display_name ?? $p->name;
return $acc;
}, []);
@@ -112,6 +111,7 @@ class ActivityService
// Resolve <user:id> placeholders to actual names/display names
$messageData['content'] = preg_replace_callback('/<user:(\d+)>/', function ($matches) use ($participantsMap) {
$userId = $matches[1];
return $participantsMap[$userId] ?? "User #{$userId}";
}, $message->content);
@@ -140,7 +140,7 @@ class ActivityService
/**
* Partition activities into read and unread, and construct the grouped entity metadata.
*/
private function partitionAndGroupActivities(array $activities, \Carbon\CarbonInterface $readAt, Dynamic $dynamic, array &$groupedDynamics): void
private function partitionAndGroupActivities(array $activities, CarbonInterface $readAt, Dynamic $dynamic, array &$groupedDynamics): void
{
$alreadyRead = [];
$unread = [];
@@ -153,7 +153,7 @@ class ActivityService
}
}
if (!empty($unread)) {
if (! empty($unread)) {
$context = array_slice($alreadyRead, 0, 2);
$groupedDynamics[] = [
@@ -192,4 +192,4 @@ class ActivityService
return '';
}
}
}