DB::table("jobs")->select("sites.name")->join("sites","sites.site_id","=","jobs.site_id")->join("shifts","sites.site_id","=","shifts.site_id")->get(); why is not working code example

Example 1: DB::table("jobs")->select("sites.name")->join("sites","sites.site_id","=","jobs.site_id")->join("shifts","sites.site_id","=","shifts.site_id")->get(); why is not working

DB::table("jobs")->select("sites.name")
                    ->join("sites","sites.site_id","=","jobs.site_id")
                    ->join("shifts","sites.site_id","=","shifts.site_id")
                   
                ->get();

Example 2: DB::table("jobs")->select("sites.name")->join("sites","sites.site_id","=","jobs.site_id")->join("shifts","sites.site_id","=","shifts.site_id")->get(); why is not working

DB::table("jobs")->select("sites.name")
                    ->join("sites","sites.site_id","=","jobs.site_id")
                    ->join("shifts","sites.site_id","=","shifts.site_id")
                   
                ->get();