Skip to content

Commit fa7fba8

Browse files
authored
Feature/entities (#757)
* Progress * Base record * Cleanup
1 parent a1a5f13 commit fa7fba8

File tree

221 files changed

+5966
-919
lines changed

Some content is hidden

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

221 files changed

+5966
-919
lines changed

.github/workflows/monorepo-split-packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
git commit -m "Update moox/core dependency to ^^3.0.3" || echo "No changes to commit"
100100
fi
101101
102-
- if: "!startsWith(github.ref, 'refs/tags/')"
102+
- if: ${{ !startsWith(github.ref, 'refs/tags/') }}
103103
uses: "symplify/monorepo-split-github-action@v2.3.0"
104104
with:
105105
tag: ${GITHUB_REF#refs/tags/}

.gitignore

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ Thumbs.db
6262
/routes/custom_*.php
6363
!/routes/custom_example.php
6464

65-
# Moox Press
65+
# Moox Press - need to be removed for the demo
6666
/public/vendor/*
67-
/public/wp/*
68-
69-
# Moox Builder
70-
/app/Builder/*/*
71-
/config/previews/*
72-
/lang/*/previews/*
73-
/resources/lang/*/previews/*
67+
/public/wp/*

app/Builder/Models/FullItem.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Builder\Models;
6+
7+
use Illuminate\Database\Eloquent\Model;
8+
use Moox\Core\Traits\Base\BaseInModel;
9+
use Moox\Core\Traits\Simple\SingleSimpleInModel;
10+
11+
class FullItem extends Model
12+
{
13+
use BaseInModel;
14+
use SingleSimpleInModel;
15+
16+
protected $table = 'preview_full_items';
17+
18+
protected $fillable = [
19+
'simple',
20+
'title',
21+
'content',
22+
'tabs',
23+
'street',
24+
'city',
25+
'postal_code',
26+
'country',
27+
'status',
28+
'type',
29+
];
30+
31+
protected $casts = [
32+
];
33+
}

app/Builder/Models/LightItem.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Builder\Models;
6+
7+
use Illuminate\Database\Eloquent\Model;
8+
9+
class LightItem extends Model
10+
{
11+
protected $table = 'preview_light_items';
12+
13+
protected $fillable = [
14+
'light',
15+
'title',
16+
'slug',
17+
'content',
18+
'street',
19+
'city',
20+
'postal_code',
21+
'country',
22+
'status',
23+
'type',
24+
];
25+
26+
protected $casts = [
27+
'slug' => 'string',
28+
'title' => 'string',
29+
];
30+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Builder\Models;
6+
7+
use Illuminate\Database\Eloquent\Model;
8+
use Moox\Core\Traits\Base\BaseInModel;
9+
use Moox\Core\Traits\Simple\SingleSimpleInModel;
10+
11+
class NestedTaxonomy extends Model
12+
{
13+
use BaseInModel;
14+
use SingleSimpleInModel;
15+
16+
protected $table = 'preview_nested_taxonomies';
17+
18+
protected $fillable = [
19+
'simple',
20+
'title',
21+
'slug',
22+
'description',
23+
];
24+
25+
protected $casts = [
26+
];
27+
}

app/Builder/Models/PublishItem.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Builder\Models;
6+
7+
use Illuminate\Database\Eloquent\Builder;
8+
use Illuminate\Database\Eloquent\Model;
9+
use Moox\Core\Traits\Base\BaseInModel;
10+
use Moox\Core\Traits\Publish\SinglePublishInModel;
11+
12+
class PublishItem extends Model
13+
{
14+
use BaseInModel, SinglePublishInModel;
15+
16+
protected $table = 'preview_publish_items';
17+
18+
protected $fillable = [
19+
'title',
20+
'slug',
21+
'tabs',
22+
'publish',
23+
'content',
24+
];
25+
26+
protected $casts = [
27+
'slug' => 'string',
28+
'title' => 'string',
29+
];
30+
31+
public function scopePublished(Builder $query): Builder
32+
{
33+
return $query->where('publish->status', 'published');
34+
}
35+
36+
public function scopeScheduled(Builder $query): Builder
37+
{
38+
return $query->where('publish->status', 'scheduled');
39+
}
40+
41+
public function scopeDraft(Builder $query): Builder
42+
{
43+
return $query->where('publish->status', 'draft');
44+
}
45+
}

app/Builder/Models/SimpleItem.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Builder\Models;
6+
7+
use Illuminate\Database\Eloquent\Model;
8+
use Moox\Core\Traits\Taxonomy\HasModelTaxonomy;
9+
10+
class SimpleItem extends Model
11+
{
12+
use HasModelTaxonomy;
13+
14+
protected $table = 'preview_simple_items';
15+
16+
protected $fillable = [
17+
'simple',
18+
'title',
19+
'slug',
20+
'content',
21+
'tabs',
22+
'taxonomy',
23+
'taxonomy',
24+
'street',
25+
'city',
26+
'postal_code',
27+
'country',
28+
'status',
29+
'type',
30+
];
31+
32+
protected $casts = [
33+
'slug' => 'string',
34+
'title' => 'string',
35+
];
36+
37+
protected function getResourceName(): string
38+
{
39+
return 'simple-item';
40+
}
41+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Builder\Models;
6+
7+
use Illuminate\Database\Eloquent\Model;
8+
9+
class SimpleTaxonomy extends Model
10+
{
11+
protected $table = 'preview_simple_taxonomies';
12+
13+
protected $fillable = [
14+
'title',
15+
'slug',
16+
'description',
17+
];
18+
19+
protected $casts = [
20+
];
21+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Builder\Models;
6+
7+
use Illuminate\Database\Eloquent\Model;
8+
use Moox\Core\Traits\Base\BaseInModel;
9+
use Moox\Core\Traits\SoftDelete\SingleSoftDeleteInModel;
10+
use Moox\Core\Traits\Taxonomy\HasModelTaxonomy;
11+
12+
class SoftDeleteItem extends Model
13+
{
14+
use BaseInModel, HasModelTaxonomy, SingleSoftDeleteInModel;
15+
16+
protected $table = 'preview_soft_delete_items';
17+
18+
protected $fillable = [
19+
'title',
20+
'slug',
21+
'content',
22+
'tabs',
23+
'taxonomy',
24+
'taxonomy',
25+
'address_section',
26+
'type',
27+
'status',
28+
'softDelete',
29+
];
30+
31+
protected $casts = [
32+
'slug' => 'string',
33+
'title' => 'string',
34+
];
35+
36+
protected function getResourceName(): string
37+
{
38+
return 'soft-delete-item';
39+
}
40+
}

app/Builder/Models/SoftItem.php

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Builder\Models;
6+
7+
use Illuminate\Database\Eloquent\Model;
8+
use Moox\Core\Traits\Base\BaseInModel;
9+
use Moox\Core\Traits\SoftDelete\SingleSoftDeleteInModel;
10+
11+
class SoftItem extends Model
12+
{
13+
use BaseInModel;
14+
use SingleSoftDeleteInModel;
15+
16+
protected $table = 'preview_soft_items';
17+
18+
protected $fillable = [
19+
'title',
20+
'content',
21+
'keks',
22+
'tabs',
23+
'street',
24+
'city',
25+
'postal_code',
26+
'country',
27+
'type',
28+
'status',
29+
'softDelete',
30+
];
31+
32+
protected $casts = [
33+
];
34+
}

0 commit comments

Comments
 (0)