Add deep relations

This commit is contained in:
Ludovic CANDELLIER
2022-01-14 00:03:21 +01:00
parent 95ca3c6404
commit 050fd76122
13 changed files with 159 additions and 30 deletions

View File

@@ -16,6 +16,11 @@ class Tariffs
return $export;
}
public static function getByOffer($id)
{
return Tariff::byOffer($id)->first();
}
public static function getPrices($id)
{
return Tariff::with(['price_lists.price_list_values', 'price_lists.sale_channel'])->find($id);
@@ -33,7 +38,7 @@ class Tariffs
public static function getStatuses()
{
return ['Actif','Suspendu','Invisible','Obsolete'];
return ['Actif', 'Suspendu', 'Invisible', 'Obsolete'];
}
public static function getAll()