mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
update implementation
This commit is contained in:
@ -434,7 +434,7 @@ class Estimate extends Model implements HasMedia
|
||||
$estimateTemplate = EstimateTemplate::find($this->estimate_template_id);
|
||||
|
||||
$company = Company::find($this->company_id);
|
||||
$locale = CompanySetting::getSetting('language', $company->id);
|
||||
$locale = CompanySetting::getSetting('language', $company->id);
|
||||
|
||||
App::setLocale($locale);
|
||||
|
||||
@ -510,9 +510,4 @@ class Estimate extends Model implements HasMedia
|
||||
'{ESTIMATE_LINK}' => url('/customer/estimates/pdf/'.$this->unique_hash),
|
||||
];
|
||||
}
|
||||
|
||||
public function getValues($slug)
|
||||
{
|
||||
return $this->getCustomFieldValues($slug);
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,9 +219,4 @@ class Expense extends Model implements HasMedia
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getValues($slug)
|
||||
{
|
||||
return $this->getCustomFieldValues($slug);
|
||||
}
|
||||
}
|
||||
|
||||
@ -515,7 +515,7 @@ class Invoice extends Model implements HasMedia
|
||||
$invoiceTemplate = InvoiceTemplate::find($this->invoice_template_id);
|
||||
|
||||
$company = Company::find($this->company_id);
|
||||
$locale = CompanySetting::getSetting('language', $company->id);
|
||||
$locale = CompanySetting::getSetting('language', $company->id);
|
||||
|
||||
App::setLocale($locale);
|
||||
|
||||
@ -591,9 +591,4 @@ class Invoice extends Model implements HasMedia
|
||||
'{INVOICE_LINK}' => url('/customer/invoices/pdf/'.$this->unique_hash),
|
||||
];
|
||||
}
|
||||
|
||||
public function getValues($slug)
|
||||
{
|
||||
return $this->getCustomFieldValues($slug);
|
||||
}
|
||||
}
|
||||
|
||||
@ -380,7 +380,7 @@ class Payment extends Model implements HasMedia
|
||||
public function getPDFData()
|
||||
{
|
||||
$company = Company::find($this->company_id);
|
||||
$locale = CompanySetting::getSetting('language', $company->id);
|
||||
$locale = CompanySetting::getSetting('language', $company->id);
|
||||
|
||||
\App::setLocale($locale);
|
||||
|
||||
@ -446,9 +446,4 @@ class Payment extends Model implements HasMedia
|
||||
'{PAYMENT_LINK}' => $this->paymentPdfUrl,
|
||||
];
|
||||
}
|
||||
|
||||
public function getValues($slug)
|
||||
{
|
||||
return $this->getCustomFieldValues($slug);
|
||||
}
|
||||
}
|
||||
|
||||
@ -422,9 +422,4 @@ class User extends Authenticatable implements HasMedia
|
||||
|
||||
return $companySettings;
|
||||
}
|
||||
|
||||
public function getValues($slug)
|
||||
{
|
||||
return $this->getCustomFieldValues($slug);
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,9 +43,9 @@ trait HasCustomFieldsTrait
|
||||
}
|
||||
}
|
||||
|
||||
public function getCustomFieldValues($slug)
|
||||
public function getCustomFieldBySlug($slug)
|
||||
{
|
||||
return $this->fields()->whereHas('customField', function ($query) use ($slug) {
|
||||
return $this->fields()->with('customField')->whereHas('customField', function ($query) use ($slug) {
|
||||
$query->where('slug', $slug);
|
||||
})->first();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user