Skip to content

Commit

Permalink
ödeme yöntemi
Browse files Browse the repository at this point in the history
  • Loading branch information
bulentsakarya committed Jan 27, 2024
1 parent d9552d5 commit 2bd0220
Show file tree
Hide file tree
Showing 11 changed files with 269 additions and 27 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Admin/Settings/PaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public function destroy(Payment $payment): RedirectResponse
if($gatewaysCount == 0 && $payment->is_system != 1)
{
$payment->delete();
return Redirect::route('panel.settings.payments')->with('success', __('admin/settings/payments.payment.delete.success.text'));
return Redirect::route('panel.settings.payments')->with('success', __('admin/settings/payments.destroy.success'));
}

return Redirect::back()->with('error', __('admin/settings/payments.destroy.confirmation.error.text'));
return Redirect::back()->with('error', __('admin/settings/payments.destroy.error'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function rules(): array
return [
'status' => ['required', 'integer', new Enum(Status::class)],
'title' => ['required', 'string', 'max:255', Rule::unique('payments', 'title')],
'desc' => ['string']
'desc' => ['max:255']
];
}

Expand All @@ -52,12 +52,12 @@ public function messages(): array
'title.required' => __('admin/settings/payments.title.required'),
'title.string' => __('admin/settings/payments.title.string'),
'title.max:255' => __('admin/settings/payments.title.max255'),
'title.unique' => __('admin/setting/payments.title.unique'),
'title.unique' => __('admin/settings/payments.title.unique'),

/**
* Desc Messages
*/
'desc.string' => __('admin/settings/payments.desc.string'),
'desc.max:255' => __('admin/settings/payments.desc.max255'),

];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function rules(): array
return [
'status' => ['required', new Enum(Status::class)],
'title' => ['required', 'string', 'max:255', Rule::unique('payments', 'title')->ignore($this->payment->id, 'id')],
'desc' => ['string']
'desc' => ['max:255']
];
}

Expand All @@ -51,13 +51,13 @@ public function messages(): array
*/
'title.required' => __('admin/settings/payments.title.required'),
'title.string' => __('admin/settings/payments.title.string'),
'title.max:255' => __('admin/settings/payments.title.max'),
'title.max:255' => __('admin/settings/payments.title.max255'),
'title.unique' => __('admin/settings/payments.title.unique'),

/**
* Desc Messages
*/
'desc.string' => __('admin/settings/payments.desc.string'),
'desc.max:255' => __('admin/settings/payments.desc.max255'),
];
}

Expand Down
29 changes: 29 additions & 0 deletions lang/tr/admin/settings/payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,33 @@
'table.detail' => 'Bilgiler',

'create.page.title' => 'Yeni Ödeme Yöntemi',
'form.status' => 'Durum',
'form.title' => 'Ödeme Yöntemi',
'form.desc' => 'Açıklama',
'form.submit' => 'Ödeme Yöntemi Ekle',

'edit.page.title' => 'Ödeme Yöntemini Güncelle',
'form.update' => 'Bilgileri Güncelle',
'delete.button' => 'Ödeme Yöntemini Sil',

'confirm.title' => 'Ödeme Yöntemini 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' => 'Ödeme yöntemi başarılı bir şekilde silindi',
'destroy.error' => 'Kayıt silinemedi. Lütfen ilgili kayıtları kontrol ediniz',

'store.success' => 'Ödeme yöntemi 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 ödeme yönteminin 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ı ödeme sistemi bulunmaktadır',

'desc.max255' => 'Lütfen daha kısa içerik giriniz',

];
2 changes: 2 additions & 0 deletions lang/tr/global.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

'active' => 'Etkin',
'passive' => 'Devre Dışı',
'ACTIVE' => 'Etkin',
'PASSIVE' => 'Devre Dışı',

'results' => 'sonuç',
'prev' => 'Önceki',
Expand Down
3 changes: 0 additions & 3 deletions resources/views/admin/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ class="inline-flex flex-shrink-0 justify-center text-white items-center h-5 w-5
</div>
@endif

@if (Session::has('error'))
@endif

@include('admin.layouts.header')
<main id="content" role="main">
@include('admin.layouts.navigation')
Expand Down
71 changes: 71 additions & 0 deletions resources/views/admin/settings/payments/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,77 @@
</div>
<div class="col-span-9">
<h1 class="mb-8 text-xl font-medium border-b pb-2">{{ __('admin/settings/payments.create.page.title') }}</h1>
<form action="{{ route('panel.settings.payment.create.store') }}" class="form" method="post">
@csrf
<div class="mb-4 grid gap-4 grid-cols-12">
<x-label for="status" class="block font-medium text-gray-700 col-span-3" :value="__('admin/settings/payments.form.status')" />
<div class="col-span-9">
<div id="status" class="flex justify-start">
@foreach (Status::values() as $key => $value)
<div class="mb-[0.125rem] mr-4 inline-block min-h-[1.5rem] pl-[1.5rem]">
<input
class="relative float-left -ml-[1.5rem] mr-1 mt-0.5 h-5 w-5 appearance-none rounded-full border-2 border-solid border-neutral-300 before:pointer-events-none before:absolute before:h-4 before:w-4 before:scale-0 before:rounded-full before:bg-transparent before:opacity-0 before:shadow-[0px_0px_0px_13px_transparent] before:content-[''] after:absolute after:z-[1] after:block after:h-4 after:w-4 after:rounded-full after:content-[''] checked:border-primary checked:before:opacity-[0.16] checked:after:absolute checked:after:left-1/2 checked:after:top-1/2 checked:after:h-[0.625rem] checked:after:w-[0.625rem] checked:after:rounded-full checked:after:border-primary checked:after:bg-primary checked:after:content-[''] checked:after:[transform:translate(-50%,-50%)] hover:cursor-pointer hover:before:opacity-[0.04] hover:before:shadow-[0px_0px_0px_13px_rgba(0,0,0,0.6)] focus:shadow-none focus:outline-none focus:ring-0 focus:before:scale-100 focus:before:opacity-[0.12] focus:before:shadow-[0px_0px_0px_13px_rgba(0,0,0,0.6)] focus:before:transition-[box-shadow_0.2s,transform_0.2s] checked:focus:border-primary checked:focus:before:scale-100 checked:focus:before:shadow-[0px_0px_0px_13px_#3b71ca] checked:focus:before:transition-[box-shadow_0.2s,transform_0.2s] dark:border-neutral-600 dark:checked:border-primary dark:checked:after:border-primary dark:checked:after:bg-primary dark:focus:before:shadow-[0px_0px_0px_13px_rgba(255,255,255,0.4)] dark:checked:focus:border-primary dark:checked:focus:before:shadow-[0px_0px_0px_13px_#3b71ca]"
type="radio" name="status" id="active-status" value="{{ $key }}" />
<x-label for="active-status"
class="mt-px inline-block pl-[0.15rem] hover:cursor-pointer"
:value="__('global.' . $value)" />
</div>
@endforeach
</div>
<x-input-error :messages="$errors->get('status')" class="mt-2" />
</div>
</div>
<div class="mb-4 grid gap-4 grid-cols-12">
<x-label for="title" class="block font-medium text-sm text-gray-700 col-span-3"
:value="__('admin/settings/payments.form.title')" />
<div class="relative col-span-9">
<div class="absolute inset-y-0 start-0 flex items-center pointer-events-none z-20 ps-4">
<svg class="flex-shrink-0 h-4 w-4 text-gray-600" xmlns="http://www.w3.org/2000/svg"
width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="lucide lucide-type">
<polyline points="4 7 4 4 20 4 20 7" />
<line x1="9" x2="15" y1="20" y2="20" />
<line x1="12" x2="12" y1="4" y2="20" />
</svg>
</div>
<x-input type="text" id="title" name="title"
class="py-2 px-4 ps-11 block w-full border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-slate-900 dark:border-gray-700 dark:text-gray-400 dark:focus:ring-gray-600"
placeholder="{{ __('admin/settings/payments.form.title') }}" required
autocomplete="title" />
<x-input-error :messages="$errors->get('title')" class="mt-2" />
</div>
</div>
<div class="mb-4 grid gap-4 grid-cols-12">
<x-label for="desc" class="block font-medium text-sm text-gray-700 col-span-3"
:value="__('admin/settings/payments.form.desc')" />
<div class="relative col-span-9">
<div class="absolute inset-y-0 start-0 flex items-center pointer-events-none z-20 ps-4">
<svg class="flex-shrink-0 h-4 w-4 text-gray-600" xmlns="http://www.w3.org/2000/svg"
width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="lucide lucide-quote">
<path
d="M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z" />
<path
d="M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z" />
</svg>
</div>
<x-input type="text" id="desc" name="desc"
class="py-2 px-4 ps-11 block w-full border-gray-300 focus:border-indigo-500 focus:ring-indigo-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-slate-900 dark:border-gray-700 dark:text-gray-400 dark:focus:ring-gray-600"
placeholder="{{ __('admin/settings/payments.form.desc') }}" required autocomplete="desc" />
<x-input-error :messages="$errors->get('desc')" class="mt-2" />
</div>
</div>
<div class="mt-4 grid gap-4 grid-cols-12">
<div class="col-start-4 col-span-8">
<x-submit
class="py-2 px-3 inline-flex items-center gap-x-2 text-sm font-semibold rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 dark:focus:outline-none dark:focus:ring-1 dark:focus:ring-gray-600">
{{ __('admin/settings/payments.form.submit') }}
</x-submit>
</div>
</div>
</form>
</div>
</div>
</x-admin-app-layout>
Loading

0 comments on commit 2bd0220

Please sign in to comment.