PHP code example of apility / filament-localizable-resources
1. Go to this page and download the library: Download apility/filament-localizable-resources library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
apility / filament-localizable-resources example snippets
namespace App\Filament\Resources;
use Apility\Filament\Concerns\HasLocalizableResourceLabels;
use Filament\Resources\Resource;
class ArticleResource extends Resource
{
use HasLocalizableResourceLabels;
// ...
}
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
],
];