Skip to content

Commit 6ea45c8

Browse files
committed
packages package initial commit
1 parent 9d0c871 commit 6ea45c8

File tree

31 files changed

+988
-31
lines changed

31 files changed

+988
-31
lines changed

app/Providers/Filament/AdminPanelProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
use Moox\Notification\NotificationPlugin;
3434
use Filament\Http\Middleware\Authenticate;
3535
use Moox\Training\TrainingInvitationPlugin;
36+
use Moox\Packages\Moox\Plugins\PackagesPlugin;
3637
use Illuminate\Session\Middleware\StartSession;
3738
use Illuminate\Cookie\Middleware\EncryptCookies;
3839
use Moox\Security\Services\RequestPasswordReset;
@@ -146,6 +147,9 @@ public function panel(Panel $panel): Panel
146147
StaticLanguagePlugin::make(),
147148
StaticTimezonePlugin::make(),
148149
StaticCurrencyPlugin::make(),
150+
151+
// Packages
152+
PackagesPlugin::make(),
149153
]);
150154
}
151155
}

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"moox/flag-icons-square": "*",
4242
"moox/frontend": "*",
4343
"moox/item": "*",
44+
"moox/packages": "*",
4445
"moox/jobs": "*",
4546
"moox/laravel-icons": "*",
4647
"moox/login-link": "*",
@@ -165,4 +166,4 @@
165166
},
166167
"minimum-stability": "dev",
167168
"prefer-stable": false
168-
}
169+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration {
8+
/**
9+
* Run the migrations.
10+
*/
11+
public function up(): void
12+
{
13+
Schema::create('packages', function (Blueprint $table) {
14+
$table->uuid('id')->primary();
15+
$table->string('title');
16+
$table->string('name');
17+
$table->string('vendor')->nullable();
18+
$table->string('version_installed')->nullable();
19+
$table->foreignId('installed_by_id')->nullable();
20+
$table->string('installed_by_type')->nullable();
21+
$table->foreignId('updated_by_id')->nullable();
22+
$table->enum('install_status', ['available', 'installed', 'active'])->nullable();
23+
$table->enum('update_status', ['up-to-date', 'update-available', 'update-scheduled', 'update-failed'])->nullable();
24+
$table->boolean('auto_update')->default(false);
25+
$table->boolean('is_theme')->default(false);
26+
$table->enum('package_type', ['moox_package', 'core_package', 'feature_package', 'theme_package', 'module_package', 'integration_package'])->nullable();
27+
$table->json('activation_steps')->nullable();
28+
$table->string('icon')->nullable();
29+
$table->timestamp('installed_at')->nullable();
30+
$table->timestamp('update_scheduled_at')->nullable();
31+
$table->timestamp('created_at')->nullable();
32+
$table->timestamp('updated_at')->nullable();
33+
});
34+
}
35+
36+
/**
37+
* Reverse the migrations.
38+
*/
39+
public function down(): void
40+
{
41+
Schema::dropIfExists('packages');
42+
}
43+
};

packages/media/src/MediaPlugin.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Filament\Contracts\Plugin;
77
use Moox\Media\Resources\MediaResource;
88
use Filament\Support\Concerns\EvaluatesClosures;
9-
use Moox\Media\Resources\MediaCollectionResource;
109

1110
class MediaPlugin implements Plugin
1211
{

packages/packages/.github/FUNDING.yml

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/packages/.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

packages/packages/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
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.

packages/packages/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/packages/ROADMAP.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Roadmap
2+
3+
## Current tasks
4+
5+
- [ ] Create that package

packages/packages/SECURITY.md

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 Packages` 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.

packages/packages/composer.json

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"name": "moox/packages",
3+
"description": "Packages is a simple Moox Entity, that can be used to create and manage simple entries, like logs.",
4+
"keywords": [
5+
"Moox",
6+
"Laravel",
7+
"Filament",
8+
"Moox package",
9+
"Laravel package"
10+
],
11+
"homepage": "https://moox.org/docs/packages",
12+
"license": "MIT",
13+
"authors": [
14+
{
15+
"name": "Moox Developer",
16+
"email": "[email protected]",
17+
"role": "Developer"
18+
}
19+
],
20+
"require": {
21+
"moox/core": "*"
22+
},
23+
"autoload": {
24+
"psr-4": {
25+
"Moox\\Packages\\": "src",
26+
"Moox\\Packages\\Database\\Factories\\": "database/factories"
27+
}
28+
},
29+
"extra": {
30+
"laravel": {
31+
"providers": [
32+
"Moox\\Packages\\PackagesServiceProvider"
33+
]
34+
}
35+
},
36+
"minimum-stability": "stable",
37+
"prefer-stable": true,
38+
"require-dev": {
39+
"orchestra/testbench": "^9.5",
40+
"pestphp/pest": "^3.2",
41+
"pestphp/pest-plugin-livewire": "^3.0",
42+
"pestphp/pest-plugin-laravel": "^3.0",
43+
"ryangjchandler/blade-capture-directive": "^1.0"
44+
},
45+
"autoload-dev": {
46+
"psr-4": {
47+
"Moox\\Packages\\Tests\\": "tests",
48+
"Moox\\Packages\\Database\\Factories\\": "database/factories",
49+
"Workbench\\App\\": "workbench/app/",
50+
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
51+
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
52+
}
53+
},
54+
"scripts": {
55+
"post-autoload-dump": [
56+
"@clear",
57+
"@prepare"
58+
],
59+
"clear": "@php vendor/bin/testbench package:purge-packages --ansi",
60+
"prepare": "@php vendor/bin/testbench package:discover --ansi",
61+
"build": "@php vendor/bin/testbench workbench:build --ansi",
62+
"serve": [
63+
"Composer\\Config::disableProcessTimeout",
64+
"@build",
65+
"@php vendor/bin/testbench serve --ansi"
66+
],
67+
"lint": [
68+
"@php vendor/bin/phpstan analyse --verbose --ansi"
69+
],
70+
"test": [
71+
"@php vendor/bin/phpunit"
72+
]
73+
},
74+
"config": {
75+
"allow-plugins": {
76+
"pestphp/pest-plugin": true
77+
}
78+
}
79+
}

packages/packages/config/packages.php

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?php
2+
3+
/*
4+
|--------------------------------------------------------------------------
5+
| Moox Configuration
6+
|--------------------------------------------------------------------------
7+
|
8+
| This configuration file uses translatable strings. If you want to
9+
| translate the strings, you can do so in the language files
10+
| published from moox_core. Example:
11+
|
12+
| 'trans//core::core.all',
13+
| loads from common.php
14+
| outputs 'All'
15+
|
16+
*/
17+
18+
return [
19+
'single' => 'trans//packages::packages.package',
20+
'plural' => 'trans//packages::packages.packages',
21+
'tabs' => [
22+
'all' => [
23+
'label' => 'trans//core::core.all',
24+
'icon' => 'gmdi-filter-list',
25+
'query' => [
26+
],
27+
],
28+
'0' => [
29+
'label' => 'Post',
30+
'icon' => 'gmdi-filter-list',
31+
'query' => [
32+
[
33+
'field' => 'type',
34+
'operator' => '=',
35+
'value' => 'Post',
36+
],
37+
],
38+
],
39+
'1' => [
40+
'label' => 'Page',
41+
'icon' => 'gmdi-filter-list',
42+
'query' => [
43+
[
44+
'field' => 'type',
45+
'operator' => '=',
46+
'value' => 'Page',
47+
],
48+
],
49+
],
50+
],
51+
'relations' => [],
52+
'taxonomies' => [
53+
'category' => [
54+
'label' => 'Categories',
55+
'model' => \Moox\Category\Models\Category::class,
56+
'table' => 'categorizables',
57+
'relationship' => 'categorizable',
58+
'foreignKey' => 'categorizable_id',
59+
'relatedKey' => 'category_id',
60+
'createForm' => \Moox\Category\Moox\Entities\Categories\Category\Forms\TaxonomyCreateForm::class,
61+
'hierarchical' => true,
62+
],
63+
'tag' => [
64+
'label' => 'Tags',
65+
'model' => \Moox\Tag\Models\Tag::class,
66+
'table' => 'taggables',
67+
'relationship' => 'taggable',
68+
'foreignKey' => 'taggable_id',
69+
'relatedKey' => 'tag_id',
70+
'createForm' => \Moox\Tag\Forms\TaxonomyCreateForm::class,
71+
'hierarchical' => false,
72+
],
73+
],
74+
75+
/*
76+
|--------------------------------------------------------------------------
77+
| Navigation
78+
|--------------------------------------------------------------------------
79+
|
80+
| The navigation group and sort of the Resource,
81+
| and if the panel is enabled.
82+
|
83+
*/
84+
'navigation_group' => 'DEV',
85+
];

0 commit comments

Comments
 (0)