feat: add i18n support for Vietnamese and English
This commit is contained in:
@@ -21,13 +21,18 @@ class CustomerResource extends Resource
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedUserGroup;
|
||||
|
||||
protected static ?string $pluralLabel = 'Customers';
|
||||
protected static ?string $pluralLabel = 'app.resource_customers';
|
||||
|
||||
protected static ?int $navigationSort = 2;
|
||||
|
||||
public static function getPluralLabel(): ?string
|
||||
{
|
||||
return __('app.resource_customers');
|
||||
}
|
||||
|
||||
public static function getNavigationGroup(): ?string
|
||||
{
|
||||
return 'Management';
|
||||
return __('app.nav_management');
|
||||
}
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
|
||||
@@ -12,7 +12,7 @@ class FeedbacksRelationManager extends RelationManager
|
||||
{
|
||||
protected static string $relationship = 'feedbacks';
|
||||
|
||||
protected static ?string $title = 'Feedback History';
|
||||
protected static ?string $title = 'app.feedback_history';
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
@@ -23,8 +23,8 @@ class FeedbacksRelationManager extends RelationManager
|
||||
->searchable()
|
||||
->url(fn ($record) => FeedbackResource::getUrl('edit', ['record' => $record])),
|
||||
TextColumn::make('customerProduct.product.name')
|
||||
->label('Product')
|
||||
->placeholder('General'),
|
||||
->label(__('app.product'))
|
||||
->placeholder(__('app.general')),
|
||||
TextColumn::make('status')
|
||||
->badge()
|
||||
->color(fn (string $state): string => match ($state) {
|
||||
@@ -37,10 +37,10 @@ class FeedbacksRelationManager extends RelationManager
|
||||
TextColumn::make('tags.name')
|
||||
->badge(),
|
||||
TextColumn::make('feedbackChannel.name')
|
||||
->label('Channel'),
|
||||
->label(__('app.channel')),
|
||||
TextColumn::make('interactions_count')
|
||||
->counts('interactions')
|
||||
->label('Interactions'),
|
||||
->label(__('app.interactions')),
|
||||
TextColumn::make('created_at')
|
||||
->dateTime('d/m/Y')
|
||||
->sortable(),
|
||||
@@ -48,10 +48,10 @@ class FeedbacksRelationManager extends RelationManager
|
||||
->filters([
|
||||
SelectFilter::make('status')
|
||||
->options([
|
||||
'pending' => 'Pending',
|
||||
'processing' => 'Processing',
|
||||
'resolved' => 'Resolved',
|
||||
'closed' => 'Closed',
|
||||
'pending' => __('app.status_pending'),
|
||||
'processing' => __('app.status_processing'),
|
||||
'resolved' => __('app.status_resolved'),
|
||||
'closed' => __('app.status_closed'),
|
||||
]),
|
||||
SelectFilter::make('tags')
|
||||
->relationship('tags', 'name'),
|
||||
|
||||
@@ -14,32 +14,37 @@ class CustomerForm
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
Section::make('Customer Information')
|
||||
Section::make(__('app.customer_information'))
|
||||
->schema([
|
||||
TextInput::make('name')
|
||||
->label(__('app.name'))
|
||||
->required()
|
||||
->maxLength(255),
|
||||
TextInput::make('email')
|
||||
->label(__('app.email'))
|
||||
->email()
|
||||
->maxLength(255),
|
||||
TextInput::make('phone')
|
||||
->label(__('app.phone'))
|
||||
->tel()
|
||||
->maxLength(255),
|
||||
Textarea::make('address')
|
||||
->label(__('app.address'))
|
||||
->columnSpanFull(),
|
||||
Select::make('status')
|
||||
->options([
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'active' => __('app.status_active'),
|
||||
'inactive' => __('app.status_inactive'),
|
||||
])
|
||||
->default('active')
|
||||
->required(),
|
||||
])
|
||||
->columns(2),
|
||||
|
||||
Section::make('Owned Products')
|
||||
Section::make(__('app.owned_products'))
|
||||
->schema([
|
||||
Select::make('products')
|
||||
->label(__('app.resource_products'))
|
||||
->relationship('products', 'name')
|
||||
->multiple()
|
||||
->preload()
|
||||
|
||||
@@ -33,10 +33,10 @@ class CustomersTable
|
||||
}),
|
||||
TextColumn::make('products_count')
|
||||
->counts('products')
|
||||
->label('Products'),
|
||||
->label(__('app.resource_products')),
|
||||
TextColumn::make('feedbacks_count')
|
||||
->counts('feedbacks')
|
||||
->label('Feedbacks'),
|
||||
->label(__('app.feedbacks')),
|
||||
TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
@@ -45,8 +45,8 @@ class CustomersTable
|
||||
->filters([
|
||||
SelectFilter::make('status')
|
||||
->options([
|
||||
'active' => 'Active',
|
||||
'inactive' => 'Inactive',
|
||||
'active' => __('app.status_active'),
|
||||
'inactive' => __('app.status_inactive'),
|
||||
]),
|
||||
])
|
||||
->recordActions([
|
||||
|
||||
Reference in New Issue
Block a user