Try this and see if it will work.
$ticket = Auth::user()
->with('tickets') // load first relation, add a where
->where('id', $id)
->with('tickets.ticket_replie.file') // load the stacked relation, add a where
->where('ticket_replie_id', $attachment_id)
->firstOrFail();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community