Skip to content

Commit eb4d201

Browse files
committed
Data Languages init
1 parent 1aa2fb5 commit eb4d201

File tree

19 files changed

+782
-0
lines changed

19 files changed

+782
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# These are supported funding model platforms
2+
3+
github: [mooxphp]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

packages/data-languages/.gitignore

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Environment
2+
.env
3+
.env.backup
4+
5+
# Composer
6+
/vendor
7+
composer.lock
8+
auth.json
9+
10+
# NPM / Node
11+
/node_modules
12+
npm-debug.log
13+
package-lock.json
14+
15+
# Laravel
16+
/public/hot
17+
/public/storage
18+
/storage/*.key
19+
20+
# PHPUnit
21+
.phpunit.result.cache
22+
phpunit.xml
23+
24+
# Yarn
25+
yarn-error.log
26+
27+
# PHPStan
28+
/build
29+
phpstan.neon
30+
31+
# Testbench
32+
testbench.yaml
33+
/workbench/*
34+
35+
# PHP CS Fixer
36+
.php-cs-fixer.cache
37+
38+
# Homestead
39+
Homestead.json
40+
Homestead.yaml
41+
42+
# IDEs
43+
/.idea
44+
/.vscode
45+
46+
# MacOS
47+
.DS_Store
48+
49+
# Windows
50+
Thumbs.db
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
We currently don't track changes in this package. Please refer to the [Moox Monorepo](https://github.com/mooxphp/moox) for the latest changes.
4+
5+
We'll add a changelog in the future.

packages/data-languages/LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Moox <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

packages/data-languages/README.md

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
![Moox DataLanguages](https://github.com/mooxphp/moox/raw/main/art/banner/data-languages-package.jpg)
2+
3+
# Moox Data Languages
4+
5+
This is my package data-languages
6+
7+
## Quick Installation
8+
9+
These two commmands are all you need to install the package:
10+
11+
```bash
12+
composer require moox/data-languages
13+
php artisan data-languages:install
14+
```
15+
16+
Curious what the install command does? See manual installation below.
17+
18+
## What it does
19+
20+
<!--whatdoes-->
21+
22+
This Laravel Package Template can be used to create a package including a powerful Filament resource called Item.
23+
24+
![Moox Builder Item](https://github.com/mooxphp/moox/raw/main/art/screenshot/builder-item.jpg)
25+
26+
Name and table for the Resource can be changed while building your package.
27+
28+
### Using the Template
29+
30+
1. Go to https://github.com/mooxphp/data-languages
31+
2. Press the `Use this template` button
32+
3. Create a new repository based on the template
33+
4. Clone the repository locally
34+
5. Run `php build.php`in the repo's directory and follow the steps
35+
- Author Name (Default: Moox Developer): Your Name
36+
- Author Email (Default: [email protected]): [email protected]
37+
- Package Name (Default: Blog Package): Your Package
38+
- Package Description (Default: This is my package Blog Package)
39+
- Package Entity (Default: Item): e.g. Post
40+
- Tablename (Default: items): e.g. posts
41+
42+
After building the package, you can push the changes to GitHub and create an installable package on Packagist.org. Don't forget to adjust the README to your composer namespace.
43+
44+
### Config
45+
46+
After that the Resource is highly configurable.
47+
48+
#### Tabs and Translation
49+
50+
Moox Core features like Dynamic Tabs and Translatable Config. See the config file for more details, but as a quick example:
51+
52+
```php
53+
/*
54+
|--------------------------------------------------------------------------
55+
| Tabs
56+
|--------------------------------------------------------------------------
57+
|
58+
| Define the tabs for the Resource table. They are optional, but
59+
| pretty awesome to filter the table by certain values.
60+
| You may simply do a 'tabs' => [], to disable them.
61+
|
62+
*/
63+
64+
'tabs' => [
65+
'all' => [
66+
'label' => 'trans//core::core.all',
67+
'icon' => 'gmdi-filter-list',
68+
'query' => [
69+
[
70+
'field' => 'deleted_at',
71+
'operator' => '=',
72+
'value' => null,
73+
],
74+
],
75+
],
76+
'published' => [
77+
'label' => 'trans//core::core.published',
78+
'icon' => 'gmdi-check-circle',
79+
'query' => [
80+
[
81+
'field' => 'publish_at',
82+
'operator' => '<=',
83+
'value' => function () {
84+
return now();
85+
},
86+
],
87+
[
88+
'field' => 'deleted_at',
89+
'operator' => '=',
90+
'value' => null,
91+
],
92+
],
93+
],
94+
'scheduled' => [
95+
'label' => 'trans//core::core.scheduled',
96+
'icon' => 'gmdi-schedule',
97+
'query' => [
98+
[
99+
'field' => 'publish_at',
100+
'operator' => '>',
101+
'value' => function () {
102+
return now();
103+
},
104+
],
105+
[
106+
'field' => 'deleted_at',
107+
'operator' => '=',
108+
'value' => null,
109+
],
110+
],
111+
],
112+
'draft' => [
113+
'label' => 'trans//core::core.draft',
114+
'icon' => 'gmdi-text-snippet',
115+
'query' => [
116+
[
117+
'field' => 'publish_at',
118+
'operator' => '=',
119+
'value' => null,
120+
],
121+
[
122+
'field' => 'deleted_at',
123+
'operator' => '=',
124+
'value' => null,
125+
],
126+
],
127+
],
128+
'deleted' => [
129+
'label' => 'trans//core::core.deleted',
130+
'icon' => 'gmdi-delete',
131+
'query' => [
132+
[
133+
'field' => 'deleted_at',
134+
'operator' => '!=',
135+
'value' => null,
136+
],
137+
],
138+
],
139+
],
140+
],
141+
```
142+
143+
All options for Tabs are explained in [Moox Core docs](https://github.com/mooxphp/core/blob/main/README.md#dynamic-tabs).
144+
145+
#### Item Types
146+
147+
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.
148+
149+
```php
150+
/*
151+
|--------------------------------------------------------------------------
152+
| Item Types
153+
|--------------------------------------------------------------------------
154+
|
155+
| This array contains the types of items entities. You can delete
156+
| the types you don't need and add new ones. If you don't need
157+
| types, you can empty this array like this: 'types' => [],
158+
|
159+
*/
160+
161+
'types' => [
162+
'post' => 'Post',
163+
'page' => 'Page',
164+
],
165+
```
166+
167+
#### Author Model
168+
169+
You can configure the user model used for displaying Authors. By default it is tied to App User:
170+
171+
```php
172+
/*
173+
|--------------------------------------------------------------------------
174+
| Author Model
175+
|--------------------------------------------------------------------------
176+
|
177+
| This sets the user model that can be used as author. It should be an
178+
| authenticatable model and support the morph relationship.
179+
| It should have fields similar to Moox User or WpUser.
180+
|
181+
*/
182+
183+
'author_model' => \App\Models\User::class,
184+
```
185+
186+
You may probably use Moox User
187+
188+
```php
189+
'author_model' => \Moox\User\Models\User::class,
190+
```
191+
192+
or Moox Press User instead:
193+
194+
```php
195+
'author_model' => \Moox\Press\Models\WpUser::class,
196+
```
197+
198+
<!--/whatdoes-->
199+
200+
## Manual Installation
201+
202+
Instead of using the install-command `php artisan data-languages:install` you are able to install this package manually step by step:
203+
204+
```bash
205+
// Publish and run the migrations:
206+
php artisan vendor:publish --tag="data-languages-migrations"
207+
php artisan migrate
208+
209+
// Publish the config file with:
210+
php artisan vendor:publish --tag="data-languages-config"
211+
```
212+
213+
## Changelog
214+
215+
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
216+
217+
## Security Vulnerabilities
218+
219+
Please review [our security policy](https://github.com/mooxphp/moox/security/policy) on how to report security vulnerabilities.
220+
221+
## Credits
222+
223+
- [All Contributors](../../contributors)
224+
225+
## License
226+
227+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
We maintain the current version of `Moox Data Languages` actively.
6+
7+
Do not expect security fixes for older versions.
8+
9+
## Reporting a Vulnerability
10+
11+
If you find any security-related bug, please report it to [email protected].
12+
13+
Please do not use Github issues, to give us enough time to review and fix the issue, before others can use it, to do stupid things.

0 commit comments

Comments
 (0)