modify translations 🤦

This commit is contained in:
nurmuhammet committed 2023-11-28 17:31:52 +05:00
1 parent 45b42d47e8
commit af9afd5113
28 files changed
+3240 -956

No files matched your search

+1
View File
@@ -23,6 +23,7 @@ class User extends Authenticatable
'name',
'email',
'password',
'locale',
];
/**
+3
View File
@@ -5,6 +5,7 @@
use App\Nova\Resource;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
use Nurmuhammet\NovaInputmask\NovaInputmask;
@@ -44,6 +45,8 @@ public function fields(NovaRequest $request)
return [
ID::make()->sortable(),
Text::make('phone'),
// NovaInputmask::make('Phone', 'phone')
// ->mask('+(\\9\\93)-69-99-99-99')
// ->storeRawValue(),
+1 -2
View File
@@ -25,7 +25,7 @@ public static function setLocale($event): void
$user = $event->request->user();
if (array_key_exists($user?->locale, config('app.locales'))) {
app()->setLocale($user->locale);
app()->setLocale($user->locale);
}
}
@@ -49,7 +49,6 @@ public static function localeSwitcherSave(): Closure
public static function dependsOnRegion(string $attribute = 'region', string $model = Province::class): Closure
{
return function ($field, $request, $formData) use ($attribute, $model) {
info($formData->{$attribute});
$field->options(
$formData->{$attribute}
? $model::where('region', $formData->{$attribute})->pluck('name', 'id')
+21
View File
@@ -0,0 +1,21 @@
<?php
namespace App\Rules;
use Closure;
use Illuminate\Contracts\Validation\ValidationRule;
class OnlyLetters implements ValidationRule
{
/**
* Run the validation rule.
*
* @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail
*/
public function validate(string $attribute, mixed $value, Closure $fail): void
{
if (! preg_match('/^([a-zA-Zа-яZžŽäÄňŇöÖşŞüÜçÇýÝ])+$/', $value)) {
$fail('The :attribute field must only contain letters.');
}
}
}