apility/filament-localizable-resources
最新稳定版本:v1.0.2
Composer 安装命令:
composer require apility/filament-localizable-resources
包简介
This package provides a re-usable trait for Filament Resources which adds support for localizing the resource labels.
关键字:
README 文档
README
This package provides a re-usable trait for Filament Resources which adds support for localizing the resource labels.
Installation
You can install the package via composer:
composer require apility/filament-localizable-resources
Usage
namespace App\Filament\Resources; use Apility\Filament\Concerns\HasLocalizableResourceLabels; use Filament\Resources\Resource; class ArticleResource extends Resource { use HasLocalizableResourceLabels; // ... }
The trait modifies the default methods for retrieving the resource labels to use the __() helper function to translate the labels.
It will look for the translation key in the following format:
lang/<locale>/resources.php
return [ // The resource slug is used as the translation key 'articles' => [ 'model_label' => 'article|articles', 'navigation_label' => 'Articles', // Optional, defaults to model_label 'slug' => 'articles', // Optional, will use model_label as fallback ], ];
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-16