public function getFirstWorkEmail($id) {

        $people =  $this->model->findOrfail($id);

        // The first email that is type "work"
        foreach ($people->email as $email) {

            if ($email->email_type_id == 3) {
                return $email->title;
            }
        }

        return "there is no email address";
    }
public function getFirstWorkEmail($id) {

        $people =  $this->model->findOrfail($id);

        // The first email that is type "work"
        foreach ($people->email as $email) {

            if ($email->email_type_id == 3) {
                return $email->title;
            }
        }

        return "there is no email address";
    }
public function getFirstWorkEmail ( $ id ) { $ people = $ this -> model -> findOrfail ( $ id ) ; // The first email that is type "work" foreach ( $ people -> email as $ email ) { if ( $ email -> email_type_id == 3 ) { return $ email -> title ; } } return "there is no email address" ; }
Get the first work email found for a specific People ID

@param    int    $id    PeopleID
@return   text
Get the first work email found for a specific People ID