diff --git a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php index 1414b2add..cf259dcd8 100644 --- a/addons/default/visiosoft/advs-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/advs-module/resources/config/settings/settings.php @@ -173,6 +173,7 @@ return [ 'type' => 'anomaly.field_type.checkboxes', 'required' => true, 'config' => [ + 'mode' => 'tags', 'default_value' => function () { return [config('streams::currencies.default')]; }, diff --git a/addons/default/visiosoft/advs-module/resources/js/filter_modal.js b/addons/default/visiosoft/advs-module/resources/js/filter_modal.js index 0f371ad38..a59a2f8e6 100644 --- a/addons/default/visiosoft/advs-module/resources/js/filter_modal.js +++ b/addons/default/visiosoft/advs-module/resources/js/filter_modal.js @@ -70,7 +70,7 @@ promiseForCategory.then(function (categories_list) { function CategoryField(name, level) { return '
\n' + '\n\n
'; } @@ -129,13 +129,4 @@ $('.set_category').on('click', function () { $('#filterModal').find('form').attr("action", '/advs/list'); $('#filterModal').modal('toggle'); -}); - -// Move filter on small screen -$(window).on("load resize", function () { - const width = (window.innerWidth > 0) ? window.innerWidth : screen.width; - if (width <= 575) { - const detach = $('#listFilterForm').detach(); - $('#modalListFilterForm').append(detach); - } -}); +}); \ No newline at end of file diff --git a/addons/default/visiosoft/advs-module/resources/js/list.js b/addons/default/visiosoft/advs-module/resources/js/list.js index fa86de6d9..b8d1099da 100644 --- a/addons/default/visiosoft/advs-module/resources/js/list.js +++ b/addons/default/visiosoft/advs-module/resources/js/list.js @@ -163,7 +163,8 @@ $(document).ready(function () { }); function getCities(country) { - return crudAjax(`id=${country}`, '/ajax/getCities', 'POST', () => {}, true) + return crudAjax(`id=${country}`, '/ajax/getCities', 'POST', () => { + }, true) .then(function (cities) { $('select[name="filter_City"]').html(""); $.each(cities, function (index, value) { @@ -172,9 +173,10 @@ function getCities(country) { }) } -$("#listFilterForm").submit(function(e) { +$("#listFilterForm, #listFilterFormMobile").submit(function (e) { // Disable unselected inputs - const inputs = $('#listFilterForm :input'); + const inputs = $('#' + $(this).attr('id') + ' :input'); + [...inputs].forEach((input) => { if (input.type === 'checkbox' || input.type === 'radio') { if ($(input).prop("checked") == false) { diff --git a/addons/default/visiosoft/advs-module/resources/views/list/partials/filter-modal.twig b/addons/default/visiosoft/advs-module/resources/views/list/partials/filter-modal.twig index 8ba54e038..b96a7590e 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/partials/filter-modal.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/partials/filter-modal.twig @@ -1,5 +1,6 @@ {{ asset_add('scripts.js','visiosoft.module.advs::js/filter_modal.js') }} -
+
+ {% include 'visiosoft.module.advs::list/partials/list-filter' with {"filter_id": 'listFilterFormMobile'} %} +
diff --git a/addons/default/visiosoft/advs-module/resources/views/list/partials/list-filter.twig b/addons/default/visiosoft/advs-module/resources/views/list/partials/list-filter.twig index 2c2362a4f..044e4b326 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/partials/list-filter.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/partials/list-filter.twig @@ -1,5 +1,5 @@ {% set formHtml %} -
+ {% endset %} {% set catSlug = null %} {% set citySlug = null %} @@ -12,7 +12,7 @@ {% endif %} {% if catSlug %} {% set formHtml %} - + {% endset %} {% endif %} {{ formHtml }} diff --git a/addons/default/visiosoft/advs-module/resources/views/list/partials/price-filter.twig b/addons/default/visiosoft/advs-module/resources/views/list/partials/price-filter.twig index 180820296..06734c9a3 100644 --- a/addons/default/visiosoft/advs-module/resources/views/list/partials/price-filter.twig +++ b/addons/default/visiosoft/advs-module/resources/views/list/partials/price-filter.twig @@ -1,4 +1,14 @@ -{% if setting_value('visiosoft.module.advs::hide_price_filter') == false %} +{% set hidePriceCats = setting_value('visiosoft.module.advs::hide_price_categories') %} +{% set cats = entries('cats','category').whereIn('id', hidePriceCats).get() %} +{% set isHidden = false %} + +{% for cat in cats %} + {% if request().segment(2) == cat.slug %} + {% set isHidden = true %} + {% endif %} +{% endfor %} + +{% if setting_value('visiosoft.module.advs::hide_price_filter') == false and not isHidden%}
-{% endif %} \ No newline at end of file +{% endif %} diff --git a/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig b/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig index 9faa16334..17e8aadd8 100644 --- a/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig +++ b/addons/default/visiosoft/advs-module/resources/views/new-ad/new-create.twig @@ -103,11 +103,13 @@ {% set PriceValue = form.fields.price.value|split('.') %}
- +
{% if setting_value('visiosoft.field_type.decimal::showDecimal') %}
-
{% endif %} @@ -135,11 +137,13 @@ {{ trans('visiosoft.module.advs::field.options') }}
- @@ -177,25 +181,28 @@
{{ form.fields.files.input |raw }} - +
{% for docs in form.fields.doc_files.value %} - - {{ docs.name }} - -
+ + {{ docs.name }} + +
{% endfor %}
- - {% if custom_fields and count(custom_fields) %} + {% set other_fields = addBlock('new-ad/other-fields',{'custom_fields':custom_fields}) %} + {% if other_fields or (custom_fields and count(custom_fields)) %}
{{ trans('visiosoft.module.advs::field.additional_fields') }}
- {{ addBlock('new-ad/other-fields',{'custom_fields':custom_fields})|raw }} + {{ other_fields|raw }}
{% endif %} diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvCriteria.php b/addons/default/visiosoft/advs-module/src/Adv/AdvCriteria.php index c2cdf09f0..fab2723a8 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvCriteria.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvCriteria.php @@ -96,7 +96,7 @@ class AdvCriteria extends EntryCriteria public function getCurrentLocale() { - return locale_get_display_name(config('app.locale')); + return trans('streams::locale.' . config('app.locale') . '.name'); } public function isEnabled($slug) diff --git a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php index cbf71ade1..5046f2f69 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php +++ b/addons/default/visiosoft/advs-module/src/Adv/AdvRepository.php @@ -320,6 +320,7 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface 'mime_type' => $image->mime, 'extension' => $image->extension, ]); + } $coverPhoto = 'files/images/' . $fileName; } else { diff --git a/addons/default/visiosoft/advs-module/src/Adv/Table/AdvTableColumns.php b/addons/default/visiosoft/advs-module/src/Adv/Table/AdvTableColumns.php index 5eaf015c1..d21553fd2 100644 --- a/addons/default/visiosoft/advs-module/src/Adv/Table/AdvTableColumns.php +++ b/addons/default/visiosoft/advs-module/src/Adv/Table/AdvTableColumns.php @@ -22,12 +22,16 @@ class AdvTableColumns 'wrapper' => ' #{value.id}{value.name}
- {value.finish_at} + {value.date}
{value.category}', 'value' => [ 'id' => 'entry.id', - 'finish_at' => 'entry.finish_at', + 'date' => function(EntryInterface $entry){ + $created_at = ($entry['created_at']) ?date_format($entry['created_at'], 'd.m.Y H:i'): ''; + $finish_at = ($entry['finish_at']) ? date_format($entry['finish_at'], 'd.m.Y H:i'): ''; + return $created_at . ' ' . $finish_at; + }, 'name' => function (EntryInterface $entry) { if ($entry->getTitle()) { $value = " {entry.name} "; diff --git a/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php b/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php index e3c4aabc1..362696b60 100644 --- a/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php +++ b/addons/default/visiosoft/advs-module/src/Http/Controller/AdvsController.php @@ -24,6 +24,7 @@ use Visiosoft\AdvsModule\Adv\Event\ViewAd; use Visiosoft\AdvsModule\Adv\Form\AdvFormBuilder; use Visiosoft\AdvsModule\Option\Contract\OptionRepositoryInterface; use Visiosoft\AdvsModule\OptionConfiguration\Contract\OptionConfigurationRepositoryInterface; +use Visiosoft\AdvsModule\OptionConfiguration\OptionConfigurationModel; use Visiosoft\AdvsModule\Productoption\Contract\ProductoptionRepositoryInterface; use Visiosoft\AdvsModule\ProductoptionsValue\Contract\ProductoptionsValueRepositoryInterface; use Visiosoft\CatsModule\Category\CategoryModel; diff --git a/addons/default/visiosoft/advs-module/src/OptionConfiguration/OptionConfigurationModel.php b/addons/default/visiosoft/advs-module/src/OptionConfiguration/OptionConfigurationModel.php index c7153d80d..9e54d6752 100644 --- a/addons/default/visiosoft/advs-module/src/OptionConfiguration/OptionConfigurationModel.php +++ b/addons/default/visiosoft/advs-module/src/OptionConfiguration/OptionConfigurationModel.php @@ -1,10 +1,8 @@ name . ' | ' . trim($option_group_value, ' '); } } + + public function stockControl($id, $quantity) + { + $conf = $this->newQuery()->find($id); + $stock = $conf->stock; + + if ($stock === NULL || $stock === 0) { + return 0; + } + + if ($stock < $quantity) { + return 0; + } + + return 1; + } } diff --git a/addons/default/visiosoft/advs-module/src/OptionConfiguration/OptionConfigurationRepository.php b/addons/default/visiosoft/advs-module/src/OptionConfiguration/OptionConfigurationRepository.php index 8a315f90e..27c9d2847 100644 --- a/addons/default/visiosoft/advs-module/src/OptionConfiguration/OptionConfigurationRepository.php +++ b/addons/default/visiosoft/advs-module/src/OptionConfiguration/OptionConfigurationRepository.php @@ -9,85 +9,88 @@ use Visiosoft\AdvsModule\ProductoptionsValue\Contract\ProductoptionsValueReposit class OptionConfigurationRepository extends EntryRepository implements OptionConfigurationRepositoryInterface { - /** - * The entry model. - * - * @var OptionConfigurationModel - */ - protected $model; - protected $advRepository; - protected $productOptionsValueRepository; + /** + * The entry model. + * + * @var OptionConfigurationModel + */ + protected $model; + protected $advRepository; + protected $productOptionsValueRepository; - /** - * Create a new OptionConfigurationRepository instance. - * - * @param OptionConfigurationModel $model - */ - public function __construct( - OptionConfigurationModel $model, - AdvRepositoryInterface $advRepository, - ProductoptionsValueRepositoryInterface $productoptionsValueRepository - ) - { - $this->model = $model; - $this->advRepository = $advRepository; - $this->productOptionsValueRepository = $productoptionsValueRepository; - } + /** + * Create a new OptionConfigurationRepository instance. + * + * @param OptionConfigurationModel $model + */ + public function __construct( + OptionConfigurationModel $model, + AdvRepositoryInterface $advRepository, + ProductoptionsValueRepositoryInterface $productoptionsValueRepository + ) + { + $this->model = $model; + $this->advRepository = $advRepository; + $this->productOptionsValueRepository = $productoptionsValueRepository; + } - public function createConfigration($ad_id, $price, $currency, $stock, $option_json) - { - return $this->create([ - 'parent_adv_id' => $ad_id, - 'price' => $price, - 'currency' => $currency, - 'stock' => $stock, - 'option_json' => $option_json, - ]); - } + public function createConfigration($ad_id, $price, $currency, $stock, $option_json) + { + return $this->create([ + 'parent_adv_id' => $ad_id, + 'price' => $price, + 'currency' => $currency, + 'stock' => $stock, + 'option_json' => $option_json, + ]); + } - public function getConf($ad_id) - { - $adv = $this->advRepository->find($ad_id); - $configurations = array(); + public function getConf($ad_id) + { + $adv = $this->advRepository->find($ad_id); + $configurations = array(); - $product_configurations = $this->model->where('stock', '>', '0')->where('parent_adv_id', $ad_id)->get(); + $product_configurations = $this->model->where('stock', '>', '0') + ->where('parent_adv_id', $ad_id) + ->orderBy('created_at', 'ASC') + ->get(); - foreach ($product_configurations as $product_configuration) { - $configurations_item = json_decode($product_configuration->option_json, true); - $option_group_value = ""; - foreach ($configurations_item as $option_id => $value) { - $value_entry = $this->productOptionsValueRepository->find($value); - $option_group_value .= " " . $value_entry->getName(); - } - $configurations[$product_configuration->getId()] = [ - 'name' => $option_group_value, - 'price' => $product_configuration->price, - 'currency' => $product_configuration->currency, - 'stock' => $product_configuration->stock, - 'adv' => $adv->name . ' (' . trim($option_group_value, ' ') . ')', - ]; - } + foreach ($product_configurations as $product_configuration) { + $configurations_item = json_decode($product_configuration->option_json, true); + $option_group_value = ""; + foreach ($configurations_item as $option_id => $value) { + $value_entry = $this->productOptionsValueRepository->find($value); + $option_group_value .= " " . $value_entry->getName(); + } + $configurations[$product_configuration->getId()] = [ + 'name' => $option_group_value, + 'price' => $product_configuration->price, + 'currency' => $product_configuration->currency, + 'stock' => $product_configuration->stock, + 'adv' => $adv->name . ' (' . trim($option_group_value, ' ') . ')', + ]; + } - return $configurations; - } + return $configurations; + } - public function getUnusedConfigs() - { - return $this->newQuery() + public function getUnusedConfigs() + { + return $this->newQuery() ->leftJoin('advs_advs as ads', 'advs_option_configuration.parent_adv_id', 'ads.id') ->whereNull('ads.id') ->orWhereNotNull('deleted_at') ->pluck('parent_adv_id') ->all(); - } + } - public function deleteUnusedConfigs($adsIDs) - { - return $this->newQuery()->whereIn('parent_adv_id', $adsIDs)->delete(); - } + public function deleteUnusedConfigs($adsIDs) + { + return $this->newQuery()->whereIn('parent_adv_id', $adsIDs)->delete(); + } - public function deleteAdsConfigs($adID) - { - return $this->newQuery()->where('parent_adv_id', $adID)->delete(); - } + public function deleteAdsConfigs($adID) + { + return $this->newQuery()->where('parent_adv_id', $adID)->delete(); + } } diff --git a/addons/default/visiosoft/advs-module/src/Support/_helpers.php b/addons/default/visiosoft/advs-module/src/Support/_helpers.php index 45c94b635..f5f0bc714 100644 --- a/addons/default/visiosoft/advs-module/src/Support/_helpers.php +++ b/addons/default/visiosoft/advs-module/src/Support/_helpers.php @@ -31,4 +31,16 @@ if (!function_exists('auth_id_if_null')) function auth_id_if_null($userId) { return $userId ?: auth()->id(); } +} + +if (!function_exists('replace_to_text')) +{ + function replace_to_text($content, $array) + { + foreach ($array as $key => $value) { + $content = str_replace('${' . $key . '}', $value, $content); + } + + return $content; + } } \ No newline at end of file diff --git a/addons/default/visiosoft/cats-module/src/Category/CategoryModel.php b/addons/default/visiosoft/cats-module/src/Category/CategoryModel.php index 4eef167cc..560eb498c 100644 --- a/addons/default/visiosoft/cats-module/src/Category/CategoryModel.php +++ b/addons/default/visiosoft/cats-module/src/Category/CategoryModel.php @@ -20,4 +20,26 @@ class CategoryModel extends CatsCategoryEntryModel implements CategoryInterface { return $this->parent_category; } + public function getMains($id) + { + $categories = array(); + $z = 1; + for ($i = 1; $i <= $z; $i++) { + if ($main = $this->newQuery()->where('id', $id)->first()) { + $new = array(); + $new['id'] = $main->id; + $new['val'] = $main->name; + $new['slug'] = $main->slug; + $categories[] = $new; + if ($main->parent_category_id != null) { + $id = $main->parent_category_id; + $z++; + } + } + } + $categories = array_reverse($categories); + unset($categories[count($categories) - 1]); + return $categories; + } + } diff --git a/addons/default/visiosoft/cats-module/src/Category/Contract/CategoryInterface.php b/addons/default/visiosoft/cats-module/src/Category/Contract/CategoryInterface.php index 8cd765413..f607252d3 100644 --- a/addons/default/visiosoft/cats-module/src/Category/Contract/CategoryInterface.php +++ b/addons/default/visiosoft/cats-module/src/Category/Contract/CategoryInterface.php @@ -9,4 +9,6 @@ interface CategoryInterface extends EntryInterface public function getMetaDescription(); public function getParent(); + + public function getMains($id); } diff --git a/addons/default/visiosoft/defaultadmin-theme/resources/views/table/partials/footer.twig b/addons/default/visiosoft/defaultadmin-theme/resources/views/table/partials/footer.twig new file mode 100644 index 000000000..293ce23d2 --- /dev/null +++ b/addons/default/visiosoft/defaultadmin-theme/resources/views/table/partials/footer.twig @@ -0,0 +1,62 @@ + +{% if table.actions|length or table.data.pagination.links|length %} + + + +
+ {{ buttons(table.actions)|raw }} +
+ + {% if table.data.pagination.links|length %} +
+ + + + {{ table.data.pagination.links|raw }} +
+ {% endif %} + +
+ + + +{% endif %} +{% if table.options.total_results %} + + + + {{ table.options.total_results }} {{ trans('streams::message.results') }} + + + +{% endif %} + diff --git a/addons/default/visiosoft/defaultadmin-theme/src/DefaultadminThemeServiceProvider.php b/addons/default/visiosoft/defaultadmin-theme/src/DefaultadminThemeServiceProvider.php index 17d9560e7..70fc9b229 100644 --- a/addons/default/visiosoft/defaultadmin-theme/src/DefaultadminThemeServiceProvider.php +++ b/addons/default/visiosoft/defaultadmin-theme/src/DefaultadminThemeServiceProvider.php @@ -27,6 +27,10 @@ class DefaultadminThemeServiceProvider extends AddonServiceProvider ], ]; + protected $overrides = [ + 'streams::table/partials/footer' => 'visiosoft.theme.defaultadmin::table/partials/footer' + ]; + public function register() { AbstractPaginator::$defaultView = 'visiosoft.theme.defaultadmin::pagination/bootstrap-4'; diff --git a/addons/default/visiosoft/profile-module/resources/assets/js/create.js b/addons/default/visiosoft/profile-module/resources/assets/js/create.js index 70d9e843f..bdb26f95f 100644 --- a/addons/default/visiosoft/profile-module/resources/assets/js/create.js +++ b/addons/default/visiosoft/profile-module/resources/assets/js/create.js @@ -15,7 +15,7 @@ function Locations(cat, level, name) { url: "/class/ajax", success: function (msg) { $('select[name="' + name + '"]').find('option').remove(); - $('select[name="' + name + '"]').append(''); + $('select[name="' + name + '"]').append(''); $.each(msg, function (key, value) { $('select[name="' + name + '"]').append(''); }); diff --git a/addons/default/visiosoft/profile-module/resources/config/settings/sections.php b/addons/default/visiosoft/profile-module/resources/config/settings/sections.php index 6a042d197..bddef91f7 100644 --- a/addons/default/visiosoft/profile-module/resources/config/settings/sections.php +++ b/addons/default/visiosoft/profile-module/resources/config/settings/sections.php @@ -7,6 +7,7 @@ return [ 'general_setting' => [ 'title' => 'visiosoft.module.profile::section.general_setting', 'fields' => [ + 'required_district', 'show_my_ads', 'upload_avatar', 'show_tax_office', diff --git a/addons/default/visiosoft/profile-module/resources/config/settings/settings.php b/addons/default/visiosoft/profile-module/resources/config/settings/settings.php index 35e8ba2f3..a31fc1386 100644 --- a/addons/default/visiosoft/profile-module/resources/config/settings/settings.php +++ b/addons/default/visiosoft/profile-module/resources/config/settings/settings.php @@ -70,4 +70,10 @@ return [ "education" => "anomaly.field_type.tags", "state_of_education" => "anomaly.field_type.tags", "profession" => "anomaly.field_type.tags", + 'required_district' => [ + 'type' => 'anomaly.field_type.boolean', + 'config' => [ + 'default_value' => false, + ] + ], ]; \ No newline at end of file diff --git a/addons/default/visiosoft/profile-module/resources/lang/en/setting.php b/addons/default/visiosoft/profile-module/resources/lang/en/setting.php index ff66a5ce9..66f1d2099 100644 --- a/addons/default/visiosoft/profile-module/resources/lang/en/setting.php +++ b/addons/default/visiosoft/profile-module/resources/lang/en/setting.php @@ -47,4 +47,7 @@ return [ 'name' => 'Hide Register Type in Profile Page', 'instructions' => 'Hides the register type field in the profile edit page.', ], + 'required_district' => [ + 'name' => 'Required District' + ], ]; diff --git a/addons/default/visiosoft/profile-module/src/Adress/Form/AdressFormFields.php b/addons/default/visiosoft/profile-module/src/Adress/Form/AdressFormFields.php index 1f99c9871..f650d7375 100644 --- a/addons/default/visiosoft/profile-module/src/Adress/Form/AdressFormFields.php +++ b/addons/default/visiosoft/profile-module/src/Adress/Form/AdressFormFields.php @@ -26,7 +26,9 @@ class AdressFormFields 'city' => [ 'required' => true, ], - 'district', + 'district' => [ + 'required' => setting_value( 'visiosoft.module.profile::required_district'), + ], 'adress_content' => [ 'required' => true, ], diff --git a/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php b/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php index 3bc410054..18f60162f 100644 --- a/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php +++ b/addons/default/visiosoft/profile-module/src/Http/Controller/MyProfileController.php @@ -134,8 +134,15 @@ class MyProfileController extends PublicController { $message = []; + $error_district = false; + if (setting_value('visiosoft.module.profile::required_district') and (!$this->request->district or $this->request->district == "")) { + $error_district = true; + } + $error = $form->build()->validate()->getFormErrors()->getMessages(); - if (!empty($error)) { + + if (!empty($error) or $error_district) { + $this->messages->flush(); $message['status'] = "error"; $message['msg'] = trans('visiosoft.module.profile::message.required_all'); return $message; @@ -248,19 +255,19 @@ class MyProfileController extends PublicController return response()->json(['status' => 'success', 'data' => $profile]); } - public function getEducation(Request $request) - { - $user = $this->userRepository->find(auth()->id()); - $education = EducationModel::all(); - $educationPart = EducationPartModel::query()->where('education_id', $user->education)->get(); - return response()->json(['user' => $user, 'education' => $education, 'education-part' => $educationPart], 200); - } + public function getEducation(Request $request) + { + $user = $this->userRepository->find(auth()->id()); + $education = EducationModel::all(); + $educationPart = EducationPartModel::query()->where('education_id', $user->education)->get(); + return response()->json(['user' => $user, 'education' => $education, 'education-part' => $educationPart], 200); + } - public function changeEducation(Request $request) - { - if ($request->info == 'education') { - $education = EducationPartModel::query()->where('education_id', $request->education)->get(); - } - return response()->json(['data' => $education], 200); - } + public function changeEducation(Request $request) + { + if ($request->info == 'education') { + $education = EducationPartModel::query()->where('education_id', $request->education)->get(); + } + return response()->json(['data' => $education], 200); + } } diff --git a/app/Lang/Loader.php b/app/Lang/Loader.php index e0e333626..84407a3a5 100644 --- a/app/Lang/Loader.php +++ b/app/Lang/Loader.php @@ -180,6 +180,17 @@ class Loader extends FileLoader $lines = array_replace_recursive($lines, $this->files->getRequire($file)); } } + + //Override System + $override_list = config('streams::translate.override'); + + foreach ($override_list as $override) { + $override = explode(':', $override); + if (count($override) > 1) { + $lines = $this->findArrayValue($override[0], $override[1], $lines); + } + } + if (config()->has('override_text')) { foreach (config()->get('override_text') as $override) { $override = explode(':', $override); diff --git a/resources/streams/config/translate.php b/resources/streams/config/translate.php new file mode 100644 index 000000000..41135f165 --- /dev/null +++ b/resources/streams/config/translate.php @@ -0,0 +1,7 @@ + [ + 'Sümüklüböcek:Benzersiz İsim', + ], +]; \ No newline at end of file