I do currently use this code to retrieve the required data from my database
$query = DB::table('packages')
->join('assigned_packages', function($join) use($id)
{
$join->on('packages.id', '=', 'assigned_packages.registered_package_id')
->where('assigned_packages.customer_id', '=', $id);
})
->join('registered_packages', function($join)
{
$join->on('packages.id', '=', 'registered_packages.id')
->on('registered_packages.id', '=', 'assigned_packages.registered_package_id');
});