Skip to content

Commit 5c2e105

Browse files
committed
Merge branch 'main' into feat/product-tax
2 parents 7273146 + f63fd30 commit 5c2e105

134 files changed

Lines changed: 3839 additions & 1181 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test-runner.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
name: Tests
22

33
on:
4-
# Run testing on all push and pull requests for the main branch that have committed changes in PHP files
4+
# Run testing on all push and pull requests that have committed changes in PHP files
55
push:
6-
branches: [ "main" ]
76
paths:
8-
- '**.php'
7+
- '**/*.php'
98
pull_request:
10-
branches: [ "main" ]
119
paths:
12-
- '**.php'
10+
- '**/*.php'
1311
# Make it possible to run the workflow manually
1412
workflow_dispatch:
1513

@@ -68,7 +66,7 @@ jobs:
6866

6967
- name: Install dependencies
7068
run: |
71-
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "filament/support:^3.3" --no-interaction --no-update
69+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
7270
composer update --${{ matrix.dependency-version }} --prefer-dist --no-progress --no-interaction
7371
7472
- name: Run test suite

composer.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,19 @@
4545
},
4646
"require": {
4747
"php": "^8.2",
48-
"bezhansalleh/filament-shield": "^3.3",
48+
"bezhansalleh/filament-shield": "^4.0",
4949
"datalinx/php-utils": "^2.5",
5050
"eclipsephp/common": "dev-main",
5151
"eclipsephp/world-plugin": "dev-main",
52-
"filament/filament": "^3.3",
53-
"filament/spatie-laravel-media-library-plugin": "^3.2",
54-
"filament/spatie-laravel-translatable-plugin": "^3.2",
52+
"filament/filament": "^4.0",
53+
"filament/spatie-laravel-media-library-plugin": "^4.0",
54+
"lara-zeus/spatie-translatable": "^1.0",
5555
"laravel/framework": "^11.0|^12.0",
56-
"solution-forest/filament-tree": "^2.1",
56+
"nben/filament-record-nav": "^1.0",
57+
"phpoffice/phpspreadsheet": "^1.30",
58+
"solution-forest/filament-tree": "^3.0",
5759
"spatie/laravel-package-tools": "^1.19",
58-
"spatie/laravel-translatable": "^6.11",
59-
"nben/filament-record-nav": "^1.0"
60+
"spatie/laravel-translatable": "^6.11"
6061
},
6162
"require-dev": {
6263
"laravel/pint": "^1.21",

config/filament-shield.php

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?php
2+
3+
return [
4+
'shield_resource' => [
5+
'slug' => 'shield/roles',
6+
'show_model_path' => true,
7+
'cluster' => null,
8+
'tabs' => [
9+
'pages' => true,
10+
'widgets' => true,
11+
'resources' => true,
12+
'custom_permissions' => true,
13+
],
14+
],
15+
16+
'tenant_model' => \Eclipse\Core\Models\Site::class,
17+
18+
'auth_provider_model' => \Eclipse\Core\Models\User::class,
19+
20+
'super_admin' => [
21+
'enabled' => true,
22+
'name' => 'super_admin',
23+
'define_via_gate' => false,
24+
'intercept_gate' => 'before',
25+
],
26+
27+
'panel_user' => [
28+
'enabled' => true,
29+
'name' => 'panel_user',
30+
],
31+
32+
'permissions' => [
33+
'separator' => '_',
34+
'case' => 'lower_snake',
35+
'generate' => true,
36+
],
37+
38+
'policies' => [
39+
'path' => app_path('Policies'),
40+
'merge' => false,
41+
'generate' => true,
42+
'methods' => [
43+
'viewAny', 'view', 'create', 'update', 'restore', 'restoreAny',
44+
'replicate', 'reorder', 'delete', 'deleteAny', 'forceDelete', 'forceDeleteAny',
45+
],
46+
'single_parameter_methods' => [
47+
'viewAny', 'create', 'deleteAny', 'forceDeleteAny', 'restoreAny', 'reorder',
48+
],
49+
],
50+
51+
'localization' => [
52+
'enabled' => false,
53+
'key' => 'filament-shield::filament-shield',
54+
],
55+
56+
'resources' => [
57+
'subject' => 'model',
58+
'manage' => [],
59+
'exclude' => [],
60+
],
61+
62+
'pages' => [
63+
'subject' => 'class',
64+
'prefix' => 'view',
65+
'exclude' => [
66+
],
67+
],
68+
69+
'widgets' => [
70+
'subject' => 'class',
71+
'prefix' => 'view',
72+
'exclude' => [
73+
],
74+
],
75+
76+
'custom_permissions' => [
77+
],
78+
79+
'discovery' => [
80+
'discover_all_resources' => true,
81+
'discover_all_widgets' => true,
82+
'discover_all_pages' => true,
83+
],
84+
85+
'register_role_policy' => true,
86+
];

database/factories/ProductFactory.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
namespace Eclipse\Catalogue\Factories;
44

55
use Eclipse\Catalogue\Models\Product;
6-
use Exception;
76
use Illuminate\Database\Eloquent\Factories\Factory;
87
use Illuminate\Support\Carbon;
9-
use Illuminate\Support\Facades\Log;
108

119
class ProductFactory extends Factory
1210
{
@@ -47,21 +45,17 @@ public function definition(): array
4745
];
4846
}
4947

50-
public function configure(): static
48+
public function withImages(): static
5149
{
5250
return $this->afterCreating(function (Product $product) {
5351
$imageNumber = rand(1, 15);
5452
$imagePath = storage_path("app/public/sample-products/{$imageNumber}.jpg");
5553

5654
if (file_exists($imagePath)) {
57-
try {
58-
$product->addMedia($imagePath)
59-
->preservingOriginal()
60-
->withCustomProperties(['is_cover' => true])
61-
->toMediaCollection('images');
62-
} catch (Exception $e) {
63-
Log::warning("Failed to attach image to product {$product->id}: ".$e->getMessage());
64-
}
55+
$product->addMedia($imagePath)
56+
->preservingOriginal()
57+
->withCustomProperties(['is_cover' => true])
58+
->toMediaCollection('images');
6559
}
6660
});
6761
}

database/migrations/2025_04_14_091509_create_catalogue_products_table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
public function up(): void
1010
{
11-
Schema::create('catalogue_products', function (Blueprint $table) {
11+
Schema::create('pim_products', function (Blueprint $table) {
1212
$table->id();
1313
$table->string('code')->nullable();
1414
$table->string('barcode')->nullable();
@@ -26,6 +26,6 @@ public function up(): void
2626

2727
public function down(): void
2828
{
29-
Schema::dropIfExists('catalogue_products');
29+
Schema::dropIfExists('pim_products');
3030
}
3131
};

database/migrations/2025_07_01_141618_create_categories_table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
public function up(): void
1010
{
11-
Schema::create('catalogue_categories', function (Blueprint $table) {
11+
Schema::create('pim_categories', function (Blueprint $table) {
1212
$table->id();
1313
$table->foreignId('site_id')
1414
->constrained()
@@ -31,6 +31,6 @@ public function up(): void
3131

3232
public function down(): void
3333
{
34-
Schema::dropIfExists('catalogue_categories');
34+
Schema::dropIfExists('pim_categories');
3535
}
3636
};

database/migrations/2025_07_09_091509_add_category_to_catalogue_products_table.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88
{
99
public function up(): void
1010
{
11-
Schema::table('catalogue_products', function (Blueprint $table) {
11+
Schema::table('pim_products', function (Blueprint $table) {
1212
$table->foreignId('category_id')
1313
->nullable()
1414
->after('name')
15-
->constrained('catalogue_categories')
15+
->constrained('pim_categories')
1616
->nullOnDelete()
1717
->cascadeOnUpdate();
1818
});
1919
}
2020

2121
public function down(): void
2222
{
23-
Schema::table('catalogue_products', function (Blueprint $table) {
23+
Schema::table('pim_products', function (Blueprint $table) {
2424
$table->dropForeign(['category_id']);
2525
$table->dropColumn('category_id');
2626
});

database/migrations/2025_08_13_071152_add_product_type_id_to_catalogue_products_table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
public function up(): void
1010
{
11-
Schema::table('catalogue_products', function (Blueprint $table) {
11+
Schema::table('pim_products', function (Blueprint $table) {
1212
$table->foreignId('product_type_id')
1313
->nullable()
1414
->after('category_id')
@@ -20,7 +20,7 @@ public function up(): void
2020

2121
public function down(): void
2222
{
23-
Schema::table('catalogue_products', function (Blueprint $table) {
23+
Schema::table('pim_products', function (Blueprint $table) {
2424
$table->dropForeign(['product_type_id']);
2525
$table->dropColumn('product_type_id');
2626
});

database/migrations/2025_08_16_121410_create_product_data_table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
public function up(): void
1010
{
11-
Schema::create('catalogue_product_data', function (Blueprint $table) {
11+
Schema::create('pim_product_data', function (Blueprint $table) {
1212
$table->id();
1313
$table->foreignId('product_id');
1414

@@ -32,6 +32,6 @@ public function up(): void
3232

3333
public function down(): void
3434
{
35-
Schema::dropIfExists('catalogue_product_data');
35+
Schema::dropIfExists('pim_product_data');
3636
}
3737
};

database/migrations/2025_08_16_121654_add_product_attributes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
public function up(): void
1010
{
11-
Schema::table('catalogue_products', function (Blueprint $table) {
11+
Schema::table('pim_products', function (Blueprint $table) {
1212
$table->string('origin_country_id', 2)->nullable();
1313
$table->foreign('origin_country_id')
1414
->references('id')
@@ -24,7 +24,7 @@ public function up(): void
2424

2525
public function down(): void
2626
{
27-
Schema::table('catalogue_products', function (Blueprint $table) {
27+
Schema::table('pim_products', function (Blueprint $table) {
2828
$table->dropForeign(['origin_country_id']);
2929
$table->dropColumn([
3030
'origin_country_id',

0 commit comments

Comments
 (0)