public function subscription($subscription = 'default')
    {
        return $this->subscriptions->sortByDesc(function ($value) {
            return $value->created_at->getTimestamp();
        })->first(function ($value) use ($subscription) {
            return $value->name === $subscription;
        });
    }
public function subscription($subscription = 'default')
    {
        return $this->subscriptions->sortByDesc(function ($value) {
            return $value->created_at->getTimestamp();
        })->first(function ($value) use ($subscription) {
            return $value->name === $subscription;
        });
    }
public function subscription ( $ subscription = 'default' ) { return $ this -> subscriptions -> sortByDesc ( function ( $ value ) { return $ value -> created_at -> getTimestamp ( ) ; } ) -> first ( function ( $ value ) use ( $ subscription ) { return $ value -> name === $ subscription ; } ) ; }
Get a subscription instance by name.

@param  string  $subscription
@return \Laravel\Cashier\Subscription|null
Get a subscription instance by name .