Skip to content

Commit

Permalink
ödeme yöntemleri
Browse files Browse the repository at this point in the history
  • Loading branch information
bulentsakarya committed Jan 28, 2024
1 parent 2bd0220 commit d7162ce
Show file tree
Hide file tree
Showing 9 changed files with 566 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Admin/Settings/CurrencyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php

namespace App\Http\Requests\Admin\Settings\Currency;

use App\Enums\Status;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Illuminate\Validation\Rules\Enum;

class CurrencyCreateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}

/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|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<string, string>
*/
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'),
];
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?php

namespace App\Http\Requests\Admin\Settings\Currency;

use App\Enums\Status;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Illuminate\Validation\Rules\Enum;

class CurrencyUpdateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}

/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Currency\Validation\ValidationRule|array<mixed>|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<string, string>
*/
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'),
];
}

}
47 changes: 47 additions & 0 deletions lang/tr/admin/settings/currencies.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

return [

'page.title' => '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',

];
81 changes: 81 additions & 0 deletions resources/views/admin/settings/currencies/create.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<x-admin-app-layout>
<div class="grid grid-cols-12 gap-7">
<div class="col-span-3">
@include('admin.settings.partials.navigation')
</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 d7162ce

Please sign in to comment.