Add Turkmen localization and update Filament resources; configure timezone and locale settings
This commit is contained in:
@@ -13,6 +13,7 @@ This application is a Laravel application and its main Laravel ecosystems packag
|
|||||||
|
|
||||||
- php - 8.3.12
|
- php - 8.3.12
|
||||||
- laravel/framework (LARAVEL) - v12
|
- laravel/framework (LARAVEL) - v12
|
||||||
|
- filament/filament (FILAMENT) - v4.0
|
||||||
- laravel/prompts (PROMPTS) - v0
|
- laravel/prompts (PROMPTS) - v0
|
||||||
- laravel/pint (PINT) - v1
|
- laravel/pint (PINT) - v1
|
||||||
- laravel/sail (SAIL) - v1
|
- laravel/sail (SAIL) - v1
|
||||||
@@ -34,6 +35,15 @@ This application is a Laravel application and its main Laravel ecosystems packag
|
|||||||
## Frontend Bundling
|
## Frontend Bundling
|
||||||
- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `npm run build`, `npm run dev`, or `composer run dev`. Ask them.
|
- If the user doesn't see a frontend change reflected in the UI, it could mean they need to run `npm run build`, `npm run dev`, or `composer run dev`. Ask them.
|
||||||
|
|
||||||
|
## Localization
|
||||||
|
- App should be in Turkmen language.
|
||||||
|
- All the validation messages should be in Turkmen language.
|
||||||
|
- All the error messages should be in Turkmen language.
|
||||||
|
- All the success messages should be in Turkmen language.
|
||||||
|
|
||||||
|
## Admin panel
|
||||||
|
- Filament is used as the admin panel.
|
||||||
|
|
||||||
## Replies
|
## Replies
|
||||||
- Be concise in your explanations - focus on what's important rather than explaining obvious details.
|
- Be concise in your explanations - focus on what's important rather than explaining obvious details.
|
||||||
|
|
||||||
|
|||||||
10
app/Filament/Pages/Dashboard.php
Normal file
10
app/Filament/Pages/Dashboard.php
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Pages;
|
||||||
|
|
||||||
|
use Filament\Pages\Dashboard as BaseDashboard;
|
||||||
|
|
||||||
|
class Dashboard extends BaseDashboard
|
||||||
|
{
|
||||||
|
protected static ?string $navigationLabel = 'Dolandyryş paneli';
|
||||||
|
}
|
||||||
@@ -20,6 +20,12 @@ class DocumentResource extends Resource
|
|||||||
|
|
||||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||||
|
|
||||||
|
protected static ?string $navigationLabel = 'Resminamalar';
|
||||||
|
|
||||||
|
protected static ?string $pluralLabel = 'Resminamalar';
|
||||||
|
|
||||||
|
protected static ?int $navigationSort = 3;
|
||||||
|
|
||||||
public static function form(Schema $schema): Schema
|
public static function form(Schema $schema): Schema
|
||||||
{
|
{
|
||||||
return DocumentForm::configure($schema);
|
return DocumentForm::configure($schema);
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ use Filament\Resources\Resource;
|
|||||||
use Filament\Schemas\Schema;
|
use Filament\Schemas\Schema;
|
||||||
use Filament\Support\Icons\Heroicon;
|
use Filament\Support\Icons\Heroicon;
|
||||||
use Filament\Tables\Table;
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Contracts\Support\Htmlable;
|
||||||
|
|
||||||
class GroupResource extends Resource
|
class GroupResource extends Resource
|
||||||
{
|
{
|
||||||
@@ -21,7 +22,18 @@ class GroupResource extends Resource
|
|||||||
|
|
||||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||||
|
|
||||||
protected static ?string $recordTitleAttribute = 'namenamenamname';
|
protected static ?string $navigationLabel = 'Toparlar';
|
||||||
|
|
||||||
|
protected static ?string $pluralLabel = 'Toparlar';
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'name';
|
||||||
|
|
||||||
|
protected static ?int $navigationSort = 1;
|
||||||
|
|
||||||
|
public static function getNavigationIcon(): string | BackedEnum | Htmlable | null
|
||||||
|
{
|
||||||
|
return 'heroicon-o-user-group';
|
||||||
|
}
|
||||||
|
|
||||||
public static function form(Schema $schema): Schema
|
public static function form(Schema $schema): Schema
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ class ListGroups extends ListRecords
|
|||||||
protected function getHeaderActions(): array
|
protected function getHeaderActions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
CreateAction::make(),
|
CreateAction::make()
|
||||||
|
->label('Täze topar'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Filament\Resources\Groups\Schemas;
|
namespace App\Filament\Resources\Groups\Schemas;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
use Filament\Forms\Components\DatePicker;
|
use Filament\Forms\Components\DatePicker;
|
||||||
|
use Filament\Schemas\Components\Utilities\Set;
|
||||||
use Filament\Schemas\Schema;
|
use Filament\Schemas\Schema;
|
||||||
|
|
||||||
class GroupForm
|
class GroupForm
|
||||||
@@ -12,8 +14,13 @@ class GroupForm
|
|||||||
return $schema
|
return $schema
|
||||||
->components([
|
->components([
|
||||||
DatePicker::make('start_date')
|
DatePicker::make('start_date')
|
||||||
->required(),
|
->label('Başlanýan senesi')
|
||||||
|
->required()
|
||||||
|
->live()
|
||||||
|
->afterStateUpdated(fn(Set $set, ?string $state) => $set('end_date', $state ? Carbon::parse($state)->addDays(14)->format('Y-m-d') : null)),
|
||||||
|
|
||||||
DatePicker::make('end_date')
|
DatePicker::make('end_date')
|
||||||
|
->label('Gutarýan senesi')
|
||||||
->required(),
|
->required(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,15 +15,20 @@ class GroupsTable
|
|||||||
return $table
|
return $table
|
||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('start_date')
|
TextColumn::make('start_date')
|
||||||
|
->label('Başlanýan senesi')
|
||||||
->date()
|
->date()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
|
||||||
TextColumn::make('end_date')
|
TextColumn::make('end_date')
|
||||||
|
->label('Gutarýan senesi')
|
||||||
->date()
|
->date()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
|
||||||
TextColumn::make('created_at')
|
TextColumn::make('created_at')
|
||||||
->dateTime()
|
->dateTime()
|
||||||
->sortable()
|
->sortable()
|
||||||
->toggleable(isToggledHiddenByDefault: true),
|
->toggleable(isToggledHiddenByDefault: true),
|
||||||
|
|
||||||
TextColumn::make('updated_at')
|
TextColumn::make('updated_at')
|
||||||
->dateTime()
|
->dateTime()
|
||||||
->sortable()
|
->sortable()
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ class PilgrimResource extends Resource
|
|||||||
|
|
||||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||||
|
|
||||||
|
protected static ?string $navigationLabel = 'Zyýaratçylar';
|
||||||
|
|
||||||
|
protected static ?string $pluralLabel = 'Zyýaratçylar';
|
||||||
|
|
||||||
|
protected static ?int $navigationSort = 2;
|
||||||
|
|
||||||
public static function form(Schema $schema): Schema
|
public static function form(Schema $schema): Schema
|
||||||
{
|
{
|
||||||
return PilgrimForm::configure($schema);
|
return PilgrimForm::configure($schema);
|
||||||
|
|||||||
@@ -6,6 +6,14 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property string $name
|
||||||
|
* @property date $start_date
|
||||||
|
* @property date $end_date
|
||||||
|
* @property Pilgrim[] $pilgrims
|
||||||
|
* @property Carbon $created_at
|
||||||
|
* @property Carbon $updated_at
|
||||||
|
*/
|
||||||
class Group extends Model
|
class Group extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
namespace App\Providers\Filament;
|
namespace App\Providers\Filament;
|
||||||
|
|
||||||
|
use App\Filament\Pages\Dashboard;
|
||||||
use Filament\Http\Middleware\Authenticate;
|
use Filament\Http\Middleware\Authenticate;
|
||||||
use Filament\Http\Middleware\AuthenticateSession;
|
use Filament\Http\Middleware\AuthenticateSession;
|
||||||
use Filament\Http\Middleware\DisableBladeIconComponents;
|
use Filament\Http\Middleware\DisableBladeIconComponents;
|
||||||
use Filament\Http\Middleware\DispatchServingFilamentEvent;
|
use Filament\Http\Middleware\DispatchServingFilamentEvent;
|
||||||
use Filament\Pages\Dashboard;
|
|
||||||
use Filament\Panel;
|
use Filament\Panel;
|
||||||
use Filament\PanelProvider;
|
use Filament\PanelProvider;
|
||||||
use Filament\Support\Colors\Color;
|
use Filament\Support\Colors\Color;
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ return [
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'timezone' => 'UTC',
|
'timezone' => 'Asia/Ashgabat',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
@@ -78,9 +78,9 @@ return [
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'locale' => env('APP_LOCALE', 'en'),
|
'locale' => env('APP_LOCALE', 'tk'),
|
||||||
|
|
||||||
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'en'),
|
'fallback_locale' => env('APP_FALLBACK_LOCALE', 'tk'),
|
||||||
|
|
||||||
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
|
'faker_locale' => env('APP_FAKER_LOCALE', 'en_US'),
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace Database\Seeders;
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use App\Models\User;
|
|
||||||
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
class DatabaseSeeder extends Seeder
|
class DatabaseSeeder extends Seeder
|
||||||
@@ -13,11 +11,8 @@ class DatabaseSeeder extends Seeder
|
|||||||
*/
|
*/
|
||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
// User::factory(10)->create();
|
$this->call([
|
||||||
|
UserTableSeeder::class,
|
||||||
User::factory()->create([
|
|
||||||
'name' => 'Test User',
|
|
||||||
'email' => 'test@example.com',
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
22
database/seeders/UserTableSeeder.php
Normal file
22
database/seeders/UserTableSeeder.php
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
|
||||||
|
class UserTableSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
User::factory()->create([
|
||||||
|
'name' => 'Nurmuhammet',
|
||||||
|
'email' => 'nurmuhammet@mail.com',
|
||||||
|
'password' => Hash::make('payload10'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
13
lang/tk.json
Normal file
13
lang/tk.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"Login": "Giriş",
|
||||||
|
"Register": "Hasaba al",
|
||||||
|
"Email Address": "E-poçta salgysy",
|
||||||
|
"Password": "Açar sözi",
|
||||||
|
"Confirm Password": "Açar sözüni tassyklaň",
|
||||||
|
"Remember Me": "Meni ýatda sakla",
|
||||||
|
"Forgot Your Password?": "Açar sözüňizi unutdyňyzmy?",
|
||||||
|
"Dashboard": "Dolandyryş paneli",
|
||||||
|
"You are logged in!": "Siz içerde!",
|
||||||
|
"Name": "Ady",
|
||||||
|
"Logout": "Çykyş"
|
||||||
|
}
|
||||||
@@ -28,21 +28,21 @@
|
|||||||
href="{{ url('/dashboard') }}"
|
href="{{ url('/dashboard') }}"
|
||||||
class="inline-block px-5 py-1.5 dark:text-[#EDEDEC] border-[#19140035] hover:border-[#1915014a] border text-[#1b1b18] dark:border-[#3E3E3A] dark:hover:border-[#62605b] rounded-sm text-sm leading-normal"
|
class="inline-block px-5 py-1.5 dark:text-[#EDEDEC] border-[#19140035] hover:border-[#1915014a] border text-[#1b1b18] dark:border-[#3E3E3A] dark:hover:border-[#62605b] rounded-sm text-sm leading-normal"
|
||||||
>
|
>
|
||||||
Dashboard
|
{{ __('Dashboard') }}
|
||||||
</a>
|
</a>
|
||||||
@else
|
@else
|
||||||
<a
|
<a
|
||||||
href="{{ route('login') }}"
|
href="{{ route('login') }}"
|
||||||
class="inline-block px-5 py-1.5 dark:text-[#EDEDEC] text-[#1b1b18] border border-transparent hover:border-[#19140035] dark:hover:border-[#3E3E3A] rounded-sm text-sm leading-normal"
|
class="inline-block px-5 py-1.5 dark:text-[#EDEDEC] text-[#1b1b18] border border-transparent hover:border-[#19140035] dark:hover:border-[#3E3E3A] rounded-sm text-sm leading-normal"
|
||||||
>
|
>
|
||||||
Log in
|
{{ __('Login') }}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
@if (Route::has('register'))
|
@if (Route::has('register'))
|
||||||
<a
|
<a
|
||||||
href="{{ route('register') }}"
|
href="{{ route('register') }}"
|
||||||
class="inline-block px-5 py-1.5 dark:text-[#EDEDEC] border-[#19140035] hover:border-[#1915014a] border text-[#1b1b18] dark:border-[#3E3E3A] dark:hover:border-[#62605b] rounded-sm text-sm leading-normal">
|
class="inline-block px-5 py-1.5 dark:text-[#EDEDEC] border-[#19140035] hover:border-[#1915014a] border text-[#1b1b18] dark:border-[#3E3E3A] dark:hover:border-[#62605b] rounded-sm text-sm leading-normal">
|
||||||
Register
|
{{ __('Register') }}
|
||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
@endauth
|
@endauth
|
||||||
|
|||||||
Reference in New Issue
Block a user