https://github.com/mooxphp/data
[READ-ONLY] Static Language Data for Filament
https://github.com/mooxphp/data
Last synced: 11 months ago
JSON representation
[READ-ONLY] Static Language Data for Filament
- Host: GitHub
- URL: https://github.com/mooxphp/data
- Owner: mooxphp
- License: mit
- Created: 2023-12-11T12:22:46.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-18T15:04:54.000Z (11 months ago)
- Last Synced: 2025-03-18T16:25:20.652Z (11 months ago)
- Language: PHP
- Size: 51.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Security: SECURITY.md
Awesome Lists containing this project
README

# Moox DataLanguages
Some Static Data
## Quick Installation
These two commmands are all you need to install the package:
```bash
composer require moox/data
php artisan data:install
```
Curious what the install command does? See manual installation below.
## What it does
Static Data for country, language, Timzones, and Currencies.
also see ==> https://filamentphp.com/docs/3.x/support/render-hooks
To include it in your frontend jsut use the livewire notation
```
```
On default the component will assume the context is frontend. If thats not the chase provide the context withing the componenten.
### Using the Template
### Config
After that the Resource is highly configurable.
#### DataPanelProvider
To use the DataPanelProvider, you need to enable it in the config file:
```php
'enable-panel' => true,
```
now the panel will be available at `/data`
#### Tabs and Translation
Moox Core features like Dynamic Tabs and Translatable Config. See the config file for more details, but as a quick example:
```php
/*
|--------------------------------------------------------------------------
| Tabs
|--------------------------------------------------------------------------
|
| Define the tabs for the Resource table. They are optional, but
| pretty awesome to filter the table by certain values.
| You may simply do a 'tabs' => [], to disable them.
|
*/
'tabs' => [
'all' => [
'label' => 'trans//core::core.all',
'icon' => 'gmdi-filter-list',
'query' => [
[
'field' => 'deleted_at',
'operator' => '=',
'value' => null,
],
],
],
'published' => [
'label' => 'trans//core::core.published',
'icon' => 'gmdi-check-circle',
'query' => [
[
'field' => 'publish_at',
'operator' => '<=',
'value' => function () {
return now();
},
],
[
'field' => 'deleted_at',
'operator' => '=',
'value' => null,
],
],
],
'scheduled' => [
'label' => 'trans//core::core.scheduled',
'icon' => 'gmdi-schedule',
'query' => [
[
'field' => 'publish_at',
'operator' => '>',
'value' => function () {
return now();
},
],
[
'field' => 'deleted_at',
'operator' => '=',
'value' => null,
],
],
],
'draft' => [
'label' => 'trans//core::core.draft',
'icon' => 'gmdi-text-snippet',
'query' => [
[
'field' => 'publish_at',
'operator' => '=',
'value' => null,
],
[
'field' => 'deleted_at',
'operator' => '=',
'value' => null,
],
],
],
'deleted' => [
'label' => 'trans//core::core.deleted',
'icon' => 'gmdi-delete',
'query' => [
[
'field' => 'deleted_at',
'operator' => '!=',
'value' => null,
],
],
],
],
],
```
All options for Tabs are explained in [Moox Core docs](https://github.com/mooxphp/core/blob/main/README.md#dynamic-tabs).
#### Item Types
The item also support 'item' types, means you are able to configure selectable types for your Entity. By default, we provide "Post" and "Page" as example. If you don't want to use types, just empty the array and the field and column become invisible.
```php
/*
|--------------------------------------------------------------------------
| Item Types
|--------------------------------------------------------------------------
|
| This array contains the types of items entities. You can delete
| the types you don't need and add new ones. If you don't need
| types, you can empty this array like this: 'types' => [],
|
*/
'types' => [
'post' => 'Post',
'page' => 'Page',
],
```
#### Author Model
You can configure the user model used for displaying Authors. By default it is tied to App User:
```php
/*
|--------------------------------------------------------------------------
| Author Model
|--------------------------------------------------------------------------
|
| This sets the user model that can be used as author. It should be an
| authenticatable model and support the morph relationship.
| It should have fields similar to Moox User or WpUser.
|
*/
'author_model' => \App\Models\User::class,
```
You may probably use Moox User
```php
'author_model' => \Moox\User\Models\User::class,
```
or Moox Press User instead:
```php
'author_model' => \Moox\Press\Models\WpUser::class,
```
## Manual Installation
Instead of using the install-command `php artisan data:install` you are able to install this package manually step by step:
```bash
// Publish and run the migrations:
php artisan vendor:publish --tag="data-migrations"
php artisan migrate
// Publish the config file with:
php artisan vendor:publish --tag="data-config"
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Security Vulnerabilities
Please review [our security policy](https://github.com/mooxphp/moox/security/policy) on how to report security vulnerabilities.
## Credits
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.