Skip to content
Discussion options

You must be logged in to vote
DraggableStatus::with(['tasks' => function ($query) use ($project) {
        return $query
            ->with('user:id,avatar')
            ->select(['id', 'name', 'project_id', 'user_id', 'due_date', 'draggable_status_id'])
            ->where('project_id', $project->id)
            ->orderBy('due_date');
    }])->get();

When you select some column into with method, you need to put Foreign Key and Primary Key as well.

Replies: 5 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@zerexei
Comment options

Comment options

You must be logged in to vote
2 replies
@zerexei
Comment options

@Ifriqiya
Comment options

Comment options

You must be logged in to vote
1 reply
@Ahmadgoma
Comment options

Answer selected by zerexei
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #45631 on January 13, 2023 09:01.