scanIncomingTransfers()->each(function ($tx) { $project = Project::where('address', $tx->address)->first(); if ($project) { $tx->subaddr_index = $project->subaddr_index; } }); } public function subaddrIndex($addressDetails, $project) { return $project->id; } }