Skip to content

Commit

Permalink
fixed lang rtl data
Browse files Browse the repository at this point in the history
  • Loading branch information
A1Gard committed Feb 1, 2024
1 parent 43da834 commit 3840a09
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
33 changes: 33 additions & 0 deletions app/Http/Requests/XlangSaveRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class XlangSaveRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return auth()->check() && auth()->user()->hasRole('super-admin');
}

/**
* Get the validation rules that apply to the request.
*
* @return array<string, mixed>
*/
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'],
];
}
}
5 changes: 4 additions & 1 deletion resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
</script>
Expand Down

0 comments on commit 3840a09

Please sign in to comment.