diff --git a/app/Http/Controllers/Admin/Settings/CurrencyController.php b/app/Http/Controllers/Admin/Settings/CurrencyController.php index 5708716..b5af627 100644 --- a/app/Http/Controllers/Admin/Settings/CurrencyController.php +++ b/app/Http/Controllers/Admin/Settings/CurrencyController.php @@ -3,8 +3,8 @@ namespace App\Http\Controllers\Admin\Settings; use App\Http\Controllers\Controller; -use App\Http\Requests\Admin\Settings\CurrencyCreateRequest; -use App\Http\Requests\Admin\Settings\CurrencyUpdateRequest; +use App\Http\Requests\Admin\Settings\Currency\CurrencyCreateRequest; +use App\Http\Requests\Admin\Settings\Currency\CurrencyUpdateRequest; use App\Models\Admin\Currency; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; diff --git a/app/Http/Requests/Admin/Settings/Currency/CurrencyCreateRequest.php b/app/Http/Requests/Admin/Settings/Currency/CurrencyCreateRequest.php new file mode 100644 index 0000000..9ffe7c6 --- /dev/null +++ b/app/Http/Requests/Admin/Settings/Currency/CurrencyCreateRequest.php @@ -0,0 +1,69 @@ +|string> + */ + public function rules(): array + { + return [ + 'status' => ['required', 'integer', new Enum(Status::class)], + 'title' => ['required', 'string', 'max:255', Rule::unique('currencies', 'title')], + 'symbol' => ['required'], + 'code' => ['required'] + ]; + } + + /** + * Get the error messages for the defined validation rules. + * + * @return array + */ + public function messages(): array + { + return [ + + /** + * Status Messages + */ + 'status.required' => __('admin/settings/currencies.status.required'), + 'status.integer' => __('admin/settings/currencies.status.integer'), + + /** + * Title Messages + */ + 'title.required' => __('admin/settings/currencies.title.required'), + 'title.string' => __('admin/settings/currencies.title.string'), + 'title.max:255' => __('admin/settings/currencies.title.max255'), + 'title.unique' => __('admin/setting/currencies.title.unique'), + + /** + * Symbol Messages + */ + 'symbol.required' => __('admin/settings/currencies.symbol.required'), + + /** + * Code Messages + */ + 'code.required' => __('admin/settings/currencies.code.required'), + ]; + } +} diff --git a/app/Http/Requests/Admin/Settings/Currency/CurrencyUpdateRequest.php b/app/Http/Requests/Admin/Settings/Currency/CurrencyUpdateRequest.php new file mode 100644 index 0000000..9318b2d --- /dev/null +++ b/app/Http/Requests/Admin/Settings/Currency/CurrencyUpdateRequest.php @@ -0,0 +1,70 @@ +|string> + */ + public function rules(): array + { + return [ + 'status' => ['required', new Enum(Status::class)], + 'title' => ['required', 'string', 'max:255', Rule::unique('currencies', 'title')->ignore($this->currency->id, 'id')], + 'symbol' => ['required'], + 'code' => ['required'] + ]; + } + + /** + * Get the error messages for the defined validation rules. + * + * @return array + */ + public function messages(): array + { + return [ + + /** + * Status Messages + */ + 'status.required' => __('admin/settings/currencies.status.required'), + 'status.integer' => __('admin/settings/currencies.status.integer'), + + /** + * Title Messages + */ + 'title.required' => __('admin/settings/currencies.title.required'), + 'title.string' => __('admin/settings/currencies.title.string'), + 'title.max:255' => __('admin/settings/currencies.title.max'), + 'title.unique' => __('admin/settings/currencies.title.unique'), + + /** + * Symbol Messages + */ + 'symbol.required' => __('admin/settings/currencies.text.required'), + + /** + * Code Messages + */ + 'code.required' => __('admin/settings/currencies.text.required'), + ]; + } + +} diff --git a/lang/tr/admin/settings/currencies.php b/lang/tr/admin/settings/currencies.php new file mode 100644 index 0000000..f54d94f --- /dev/null +++ b/lang/tr/admin/settings/currencies.php @@ -0,0 +1,47 @@ + 'Para Birimleri', + 'page.text' => 'Kullanılan Para Birimleri', + + 'add.button' => 'Yeni Ekle', + 'table.status' => 'Durum', + 'table.currency' => 'Para Birimi', + 'table.codeandsymbol' => 'Kod ve Sembol', + 'table.edit' => 'Düzenle', + 'table.detail' => 'Bilgiler', + + 'create.page.title' => 'Yeni Para Birimi', + 'form.status' => 'Durum', + 'form.title' => 'Para Birimi', + 'form.desc' => 'Açıklama', + 'form.submit' => 'Para Birimi Ekle', + + 'edit.page.title' => 'Para Birimini Güncelle', + 'form.update' => 'Bilgileri Güncelle', + 'delete.button' => 'Para Birimini Sil', + + 'confirm.title' => 'Para Birimini Sil', + 'confirm.text' => 'Bu işlem geri alınamaz. Lütfen silme işleminden önce gerekli kontrolleri yaptığınızdan emin olunuz.', + 'confirm.cancel' => 'İptal Et', + 'confirm.submit' => 'Evet, Sil', + 'destroy.success' => 'Para Birimi başarılı bir şekilde silindi', + 'destroy.error' => 'Kayıt silinemedi. Lütfen ilgili kayıtları kontrol ediniz', + + 'store.success' => 'Para Birimi başarılı bir şekilde eklendi', + 'update.success' => 'Güncelleme Başarılı', + + 'status.required' => 'Durum alanı gereklidir', + 'status.integer' => 'Durum türü yanlış', + + 'title.required' => 'Lütfen Para Biriminin adını giriniz', + 'title.string' => 'Lütfen geçerli içerik giriniz', + 'title.max255' => 'Lütfen daha kısa isim giriniz', + 'title.unique' => 'Bu isimde kayıtlı para birimi bulunmaktadır', + + 'symbol.required' => 'Lütfen para birimine ait sembol giriniz', + + 'code.required' => 'Lütfen para birimi kodunu giriniz', + +]; diff --git a/resources/views/admin/settings/currencies/create.blade.php b/resources/views/admin/settings/currencies/create.blade.php new file mode 100644 index 0000000..8a76d8e --- /dev/null +++ b/resources/views/admin/settings/currencies/create.blade.php @@ -0,0 +1,81 @@ + +
+
+ @include('admin.settings.partials.navigation') +
+
+

{{ __('admin/settings/payments.create.page.title') }}

+
+ @csrf +
+ +
+
+ @foreach (Status::values() as $key => $value) +
+ + +
+ @endforeach +
+ +
+
+
+ +
+
+ + + + + +
+ + +
+
+
+ +
+
+ + + + +
+ + +
+
+
+
+ + {{ __('admin/settings/payments.form.submit') }} + +
+
+
+
+
+
diff --git a/resources/views/admin/settings/currencies/edit.blade.php b/resources/views/admin/settings/currencies/edit.blade.php new file mode 100644 index 0000000..0209b36 --- /dev/null +++ b/resources/views/admin/settings/currencies/edit.blade.php @@ -0,0 +1,154 @@ + +
+
+ @include('admin.settings.partials.navigation') +
+
+

{{ __('admin/settings/payments.edit.page.title') }}

+
+ @csrf +
+ +
+
+ @foreach (Status::values() as $key => $value) +
+ status->value == $key ? 'checked' : '' }} /> + +
+ @endforeach +
+ +
+
+
+ +
+
+ + + + + +
+ + +
+
+
+ +
+
+ + + + +
+ + +
+
+
+
+
+ + {{ __('admin/settings/payments.form.update') }} + + @if ($payment->is_system != 1) + + {{ __('admin/settings/payments.delete.button') }} + + @endif +
+
+
+
+
+
+ + +
diff --git a/resources/views/admin/settings/currencies/index.blade.php b/resources/views/admin/settings/currencies/index.blade.php new file mode 100644 index 0000000..744b090 --- /dev/null +++ b/resources/views/admin/settings/currencies/index.blade.php @@ -0,0 +1,137 @@ + +
+
+ @include('admin.settings.partials.navigation') +
+
+
+
+
+
+
+

+ {{ __('admin/settings/currencies.page.title') }} +

+

+ {{ __('admin/settings/currencies.page.text') }} +

+
+ +
+ + + + + + + + + + + @foreach ($currencies as $currency) + + + + + + + @endforeach + +
+
+ + {{ __('admin/settings/currencies.table.status') }} + +
+
+
+ + {{ __('admin/settings/currencies.table.currency') }} + +
+
+
+ + {{ __('admin/settings/currencies.table.codeandsymbol') }} + +
+
+
+ @if ($currency->status->value == 1) + + + + + + {{ Status::title($currency->status) }} + + @else + + + + + + {{ Status::title($currency->status) }} + + @endif +
+
+
+ {{ $currency->title }} +
+
+
+ {{ $currency->code . ' ' . $currency->symbol }} +
+
+ +
+
+
+

+ {{ count($currencies) }} + {{ __('global.results') }} +

+
+
+
+
+
+
+
+
diff --git a/resources/views/admin/settings/partials/navigation.blade.php b/resources/views/admin/settings/partials/navigation.blade.php index 23d97e3..aa46279 100644 --- a/resources/views/admin/settings/partials/navigation.blade.php +++ b/resources/views/admin/settings/partials/navigation.blade.php @@ -28,8 +28,8 @@ {{ __('admin/settings/navigation.menu.payments') }} - + @@ -40,8 +40,8 @@ {{ __('admin/settings/navigation.menu.locations') }} - + diff --git a/resources/views/admin/settings/settings/index.blade.php b/resources/views/admin/settings/settings/index.blade.php index 885634d..427d5bc 100644 --- a/resources/views/admin/settings/settings/index.blade.php +++ b/resources/views/admin/settings/settings/index.blade.php @@ -10,10 +10,8 @@ @csrf
-

- {{ __('admin/settings/general.app.title') }}

-

{{ __('admin/settings/general.app.text') }} -

+

{{ __('admin/settings/general.app.title') }}

+

{{ __('admin/settings/general.app.text') }}