diff --git a/README.md b/README.md
index 5c872b2..a2e8cc4 100644
--- a/README.md
+++ b/README.md
@@ -84,6 +84,17 @@ FilamentTypes::register([
]);
```
+## Config Locales
+
+You can change the locals within the `filament-types` config.
+
+- Publish the config file/
+- Modify the `locals` array to include the two character language code that applys to the language you wish to offer. EG:
+
+```
+'locals' = ['en'],
+```
+
## Use Type Helper
you can find any type with the helper method to use it anywhere
@@ -112,7 +123,7 @@ TypeColumn::make('type')
->searchable(),
```
-## Auto Caching
+## Auto Caching
on your `.env` add this
@@ -181,7 +192,7 @@ class NotesGroups extends BaseTypePage
}
```
-it will be not appear on the navigation menu by default but you can change that by just use this method
+it will be not appear on the navigation menu by default but you can change that by just use this method
```php
public static function shouldRegisterNavigation(): bool
@@ -195,7 +206,7 @@ public static function shouldRegisterNavigation(): bool
if you like to use a type as a package we create a blade component for you to make it easy to use anywhere on your app like this
```html
-
+
```
## User Types Resource Hooks
@@ -277,7 +288,7 @@ public function boot()
ManagePageActions::register([
Filament\Actions\Action::make('action')
]);
-
+
}
```
@@ -331,7 +342,6 @@ if you like to check the code by `PHPStan` just use this command
composer analyse
```
-
## Other Filament Packages
Checkout our [Awesome TomatoPHP](https://github.com/tomatophp/awesome)
diff --git a/config/filament-types.php b/config/filament-types.php
index 578d8ff..445f860 100644
--- a/config/filament-types.php
+++ b/config/filament-types.php
@@ -36,15 +36,11 @@
* Locals
*
* If you need to use locals for the types you can set it here
+ *
+ * EG: ['en','ar'] will provide English and Arabic options.
+ *
+ * Default: NULL, provides English and Arabic options.
*/
- 'locals' => [
- 'ar' => [
- 'ar' => 'العربية',
- 'en' => 'Arabic',
- ],
- 'en' => [
- 'ar' => 'الإنجليزية',
- 'en' => 'English',
- ],
- ],
+
+ 'locals' => NULL,
];
diff --git a/src/FilamentTypesPlugin.php b/src/FilamentTypesPlugin.php
index 5699286..b098ecb 100644
--- a/src/FilamentTypesPlugin.php
+++ b/src/FilamentTypesPlugin.php
@@ -9,23 +9,21 @@
class FilamentTypesPlugin implements Plugin
{
- protected static array $locals = ['ar', 'en'];
+ protected array $locals = ['ar', 'en'];
protected static array $types = [];
/**
* @return $this
*/
- public function locals(array $locals): self
+ public function locals()
{
- self::$locals = $locals;
-
- return $this;
+ return (!is_null(config('filament-types.locals'))) ? config('filament-types.locals') : $this->locals;
}
public function getLocals(): array
{
- return self::$locals;
+ return $this->locals();
}
/**