Skip to content

Conversation

@joseraul
Copy link

@joseraul joseraul commented Dec 7, 2023

Work in progress for fixing the following scenario

...
$user = User::create([]);

$task = Task::create([]);
$task->creator()->attach($user);

$task = Task::query()
    ->whereRelation('creator', 'id', $user->id)
    ->orWhereRelation('assigned', 'id', $user->id)
    ->get();
...

ideally, we would need something like:

MATCH (task:`Task`),
 (task)-[`rel_created_by_user`:`CREATOR`]-(creator:`User`),
 (task:`Task`)
OPTIONAL MATCH (task)-[`rel_assigned_to_user`:`ASSIGNED`]-(assigned:`User`)
WHERE
    id(creator) = $iduser AND 
    id(assigned) = $iduser
RETURN task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants