From 3840a09733d4703e5ce8237691d722d42478b302 Mon Sep 17 00:00:00 2001 From: A1Gard Date: Thu, 1 Feb 2024 03:47:59 +0330 Subject: [PATCH] fixed lang rtl data --- app/Http/Requests/XlangSaveRequest.php | 33 ++++++++++++++++++++++++++ resources/views/layouts/app.blade.php | 5 +++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 app/Http/Requests/XlangSaveRequest.php diff --git a/app/Http/Requests/XlangSaveRequest.php b/app/Http/Requests/XlangSaveRequest.php new file mode 100644 index 00000000..8316bad0 --- /dev/null +++ b/app/Http/Requests/XlangSaveRequest.php @@ -0,0 +1,33 @@ +check() && auth()->user()->hasRole('super-admin'); + } + + /** + * Get the validation rules that apply to the request. + * + * @return array + */ + public function rules() + { + return [ + // + 'name' => ['required','string','min:3','max:128'], + 'tag' => ['required','alpha_dash:','min:2','max:7'], + 'img' => ['nullable','file','mimes:svg,png,jpg,gif'], + ]; + } +} diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 7d713249..af3ba595 100755 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -24,7 +24,10 @@ $lang = \App\Models\Xlang::where('is_default',true)->first(); @endphp var isRtl = false; - @if($lang !== null && $lang->rtl || config('app.xlang_main') == 'fa' || config('app.xlang_main') == 'ar') + @if($lang !== null && $lang->rtl) + isRtl = true; + @endif + @if(config('app.xlang_main') == 'fa' || config('app.xlang_main') == 'ar') isRtl = true; @endif