mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 04:01:10 -04:00
Helper for custom field to get by slug
This commit is contained in:
@ -42,4 +42,11 @@ trait HasCustomFieldsTrait
|
||||
$customFieldValue->save();
|
||||
}
|
||||
}
|
||||
|
||||
public function getCustomFieldValues($slug)
|
||||
{
|
||||
return $this->fields()->whereHas('customField', function ($query) use ($slug) {
|
||||
$query->where('slug', $slug);
|
||||
})->first();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user