2019-03-02 22:44:08 +01:00
|
|
|
<?php
|
2019-05-11 05:32:07 +02:00
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-05-11 05:32:07 +02:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2024-04-12 06:15:41 +02:00
|
|
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-05-11 05:32:07 +02:00
|
|
|
*
|
2021-06-16 08:58:16 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2019-05-11 05:32:07 +02:00
|
|
|
*/
|
2019-03-02 22:44:08 +01:00
|
|
|
|
|
|
|
namespace App\Utils;
|
|
|
|
|
2024-01-14 05:05:00 +01:00
|
|
|
use Illuminate\Support\Facades\Cache;
|
2023-10-26 04:57:44 +02:00
|
|
|
use App\Models\PaymentTerm;
|
2019-03-02 22:44:08 +01:00
|
|
|
use Illuminate\Support\Str;
|
|
|
|
|
|
|
|
class TranslationHelper
|
|
|
|
{
|
2024-08-05 03:57:42 +02:00
|
|
|
// public static function getIndustries()
|
|
|
|
// {
|
2024-08-22 08:45:06 +02:00
|
|
|
|
2024-08-05 03:57:42 +02:00
|
|
|
// /** @var \Illuminate\Support\Collection<\App\Models\Currency> */
|
|
|
|
// $industries = app('industries');
|
2024-06-18 02:24:03 +02:00
|
|
|
|
2024-08-05 03:57:42 +02:00
|
|
|
// return $industries->each(function ($industry) {
|
|
|
|
// $industry->name = ctrans('texts.industry_'.$industry->name);
|
|
|
|
// })->sortBy(function ($industry) {
|
|
|
|
// return $industry->name;
|
|
|
|
// });
|
|
|
|
// }
|
2019-03-02 22:44:08 +01:00
|
|
|
|
2019-12-30 22:59:12 +01:00
|
|
|
public static function getCountries()
|
|
|
|
{
|
2024-08-22 08:45:06 +02:00
|
|
|
|
2024-06-18 02:24:03 +02:00
|
|
|
/** @var \Illuminate\Support\Collection<\App\Models\Country> */
|
2024-08-05 03:57:42 +02:00
|
|
|
return app('countries');
|
2024-06-18 02:24:03 +02:00
|
|
|
|
2019-12-30 22:59:12 +01:00
|
|
|
}
|
2019-03-02 22:44:08 +01:00
|
|
|
|
2024-08-05 03:57:42 +02:00
|
|
|
// public static function getPaymentTypes()
|
|
|
|
// {
|
2024-08-22 08:45:06 +02:00
|
|
|
|
2024-08-05 03:57:42 +02:00
|
|
|
// /** @var \Illuminate\Support\Collection<\App\Models\PaymentType> */
|
|
|
|
// // $payment_types = app('payment_types');
|
2024-06-18 02:24:03 +02:00
|
|
|
|
2024-08-05 03:57:42 +02:00
|
|
|
// return \App\Models\PaymentType::all()->each(function ($pType) {
|
|
|
|
// $pType->name = ctrans('texts.payment_type_'.$pType->name);
|
|
|
|
// })->sortBy(function ($pType) {
|
|
|
|
// return $pType->name;
|
|
|
|
// });
|
|
|
|
// }
|
2019-03-02 22:44:08 +01:00
|
|
|
|
2024-08-05 03:57:42 +02:00
|
|
|
// public static function getLanguages()
|
|
|
|
// {
|
2024-08-22 08:45:06 +02:00
|
|
|
|
2024-08-05 03:57:42 +02:00
|
|
|
// /** @var \Illuminate\Support\Collection<\App\Models\Language> */
|
|
|
|
// // $languages = app('languages');
|
2024-06-18 02:24:03 +02:00
|
|
|
|
2024-08-05 03:57:42 +02:00
|
|
|
// return \App\Models\Language::all()->each(function ($lang) {
|
|
|
|
// $lang->name = ctrans('texts.lang_'.$lang->name);
|
|
|
|
// })->sortBy(function ($lang) {
|
|
|
|
// return $lang->name;
|
|
|
|
// });
|
|
|
|
// }
|
2019-03-02 22:44:08 +01:00
|
|
|
|
2019-12-30 22:59:12 +01:00
|
|
|
public static function getCurrencies()
|
|
|
|
{
|
2024-08-22 08:45:06 +02:00
|
|
|
|
2024-06-18 02:24:03 +02:00
|
|
|
/** @var \Illuminate\Support\Collection<\App\Models\Currency> */
|
2024-08-05 03:57:42 +02:00
|
|
|
return app('currencies');
|
2024-06-18 02:24:03 +02:00
|
|
|
|
2019-12-30 22:59:12 +01:00
|
|
|
}
|
2019-03-02 22:44:08 +01:00
|
|
|
|
2024-08-05 03:57:42 +02:00
|
|
|
// public static function getPaymentTerms()
|
|
|
|
// {
|
|
|
|
// return PaymentTerm::getCompanyTerms()->map(function ($term) {
|
|
|
|
// $term['name'] = ctrans('texts.payment_terms_net').' '.$term['num_days'];
|
2020-09-06 11:38:10 +02:00
|
|
|
|
2024-08-05 03:57:42 +02:00
|
|
|
// return $term;
|
|
|
|
// });
|
|
|
|
// }
|
2019-12-30 22:59:12 +01:00
|
|
|
}
|