app/Services/ContactServices.php
/***
     * Returns the contact based on email address
     * @param $id
     * @return mixed
     */
Returns the contact based on email address
@param $id
@return mixed
Returns the contact based on email address @param $id @return mixed
public static function customerByID($id)
    {
        if ($id) {
            return Contact::with([
                "account.subscriptions" => function ($query) {
                    $query->active()->latest();
                },
                "account.bills" => function ($query) {
                    $query->latest();
                },
                "account.transactions" => function ($query) {
                    $query->latest()->first();
                },
            ])
                ->customer()
                ->where("id", $id)
                ->get();
        }
        return null;
    }
public static function customerByID ( $ id ) { if ( $ id ) { return Contact :: with ( [ " account.subscriptions " => function ( $ query ) { $ query -> active ( ) -> latest ( ) ; } , " account.bills " => function ( $ query ) { $ query -> latest ( ) ; } , " account.transactions " => function ( $ query ) { $ query -> latest ( ) -> first ( ) ; } , ] ) -> customer ( ) -> where ( " id " , $ id ) -> get ( ) ; } return null ; }
Returns the contact based on email address
 @param $id
 @return mixed
Returns the contact based on email address @param $id @return mixed