mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-22 05:53:58 +00:00
23 lines
580 B
PHP
23 lines
580 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Companies\Services;
|
|
|
|
|
|
use App\Classes\ValueObjects\Constants\SegmentConstants;
|
|
use App\Models\Company;
|
|
|
|
class FetchesCompanyPaymentAttemptLimit
|
|
{
|
|
|
|
/**
|
|
* @param Company $company
|
|
* @return mixed
|
|
*/
|
|
public function execute(Company $company){
|
|
return $company->segments()->with([
|
|
'constants' => function ($query) {
|
|
$query->where('reference', SegmentConstants::PAYMENT_ATTEMPT_DURATION_LIMIT);
|
|
}])->get()->pluck('constants')->flatten()->pluck('detail')->max('minutes');
|
|
}
|
|
|
|
} |