Skip to content

Commit

Permalink
Merge 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Voltra committed Jun 7, 2024
2 parents 1052a49 + 0b1a47a commit af0224d
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.6.0
uses: dependabot/fetch-metadata@v2.1.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fix-php-code-style-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
ref: ${{ github.head_ref }}

- name: Fix PHP code style issues
uses: aglipanci/laravel-pint-action@2.3.1
uses: aglipanci/laravel-pint-action@2.4

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
18 changes: 14 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,33 @@ name: run-tests

on:
push:
branches: [1.x, 2.x]
branches:
- 1.x
- 2.x
pull_request:
branches: [1.x, 2.x]
branches:
- 1.x
- 2.x

jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.1]
laravel: [10.*]
php: [8.1, '8.2']
laravel: ['10.*', '11.*']
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*
exclude:
- laravel: 11.*
php: 8.1

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand Down
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,54 @@

All notable changes to `filament-fabricator` will be documented in this file.

## v2.2.2 - 2024-05-12

### What's Changed

* build(deps): bump aglipanci/laravel-pint-action from 2.3.1 to 2.4 by @dependabot in https://github.com/Z3d0X/filament-fabricator/pull/152
* build(deps): bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 by @dependabot in https://github.com/Z3d0X/filament-fabricator/pull/156
* Allow string IDs by @rojtjo in https://github.com/Z3d0X/filament-fabricator/pull/158

### New Contributors

* @rojtjo made their first contribution in https://github.com/Z3d0X/filament-fabricator/pull/158

**Full Changelog**: https://github.com/Z3d0X/filament-fabricator/compare/v2.2.1...v2.2.2

## v2.2.1 - 2024-04-15

### What's Changed

* build(deps): bump dependabot/fetch-metadata from 1.6.0 to 2.0.0 by @dependabot in https://github.com/Z3d0X/filament-fabricator/pull/148
* Add note to README regarding the plugin assets by @pboivin in https://github.com/Z3d0X/filament-fabricator/pull/149
* Fixed incorrect table name during migration by @witaway in https://github.com/Z3d0X/filament-fabricator/pull/151

### New Contributors

* @pboivin made their first contribution in https://github.com/Z3d0X/filament-fabricator/pull/149
* @witaway made their first contribution in https://github.com/Z3d0X/filament-fabricator/pull/151

**Full Changelog**: https://github.com/Z3d0X/filament-fabricator/compare/v2.2.0...v2.2.1

## v2.2.0 - 2024-03-12

### Laravel 11.x compatibility added

#### What's Changed

* build(deps): bump ramsey/composer-install from 2 to 3 by @dependabot in https://github.com/Z3d0X/filament-fabricator/pull/143
* Laravel 11.x Compatibility by @laravel-shift in https://github.com/Z3d0X/filament-fabricator/pull/142

**Full Changelog**: https://github.com/Z3d0X/filament-fabricator/compare/v2.1.1...v2.2.0

## v2.1.1 - 2024-02-19

### What's Changed

* Fix Resource Registration by @Z3d0X in https://github.com/Z3d0X/filament-fabricator/pull/140

**Full Changelog**: https://github.com/Z3d0X/filament-fabricator/compare/v2.1.0...v2.1.1

## v2.1.0 - 2024-02-09

### What's Changed
Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@

***What is Filament Fabricator?*** Filament Fabricator is simply said a block-based page builder skeleton. Filament Fabricator takes care of the PageResource & frontend routing, so you can focus on what really matters: your [Layouts](https://filamentphp.com/plugins/z3d0x-fabricator#layouts) & [Page Blocks](https://filamentphp.com/plugins/z3d0x-fabricator#page-blocks).

## Compatibility
| Fabricator | Filament | PHP |
|------|----------|--------|
| [1.x](https://github.com/z3d0x/filament-fabricator/tree/1.x) | ^2.0 | ^8.0 |
| [2.x](https://github.com/z3d0x/filament-fabricator/tree/2.x) | ^3.0 | ^8.1 |

## Installation

You can install the package via composer:
Expand Down Expand Up @@ -40,11 +46,11 @@ public function panel(Panel $panel): Panel
}
```

## Compatibility
| Fabricator | Filament | PHP |
|------|----------|--------|
| [1.x](https://github.com/z3d0x/filament-fabricator/tree/1.x) | ^2.0 | ^8.0 |
| [2.x](https://github.com/z3d0x/filament-fabricator/tree/2.x) | ^3.0 | ^8.1 |
Then, publish the registered plugin assets:

```
php artisan filament:assets
```

## Documentation

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
"require": {
"php": "^8.1",
"filament/filament": "^3.0",
"illuminate/contracts": "^9.0 | ^10.0",
"illuminate/contracts": "^9.0 | ^10.0 | ^11.0",
"pboivin/filament-peek": "^2.0",
"spatie/laravel-package-tools": "^1.13.5"
},
"require-dev": {
"laravel/pint": "^1.0",
"nunomaduro/collision": "^7.0",
"nunomaduro/collision": "^7.0 | ^8.0",
"nunomaduro/larastan": "^2.0.1",
"orchestra/testbench": "^8.0",
"orchestra/testbench": "^8.0 | ^9.0",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
"pestphp/pest-plugin-livewire": "^2.0",
Expand Down
2 changes: 1 addition & 1 deletion database/migrations/create_pages_table.php.stub
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ return new class extends Migration
$table->string('slug')->unique();
$table->string('layout')->default('default')->index();
$table->json('blocks');
$table->foreignId('parent_id')->nullable()->constrained('pages')->cascadeOnDelete()->cascadeOnUpdate();
$table->foreignId('parent_id')->nullable()->constrained(config('filament-fabricator.table_name', 'pages'))->cascadeOnDelete()->cascadeOnUpdate();
$table->timestamps();
});
}
Expand Down
7 changes: 7 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ public function panel(Panel $panel): Panel
}
```

Then, publish the registered plugin assets:

```
php artisan filament:assets
```


To get started create a [Layout](#layouts) and then [Page Blocks](#page-blocks)

## Layouts
Expand Down
1 change: 1 addition & 0 deletions src/FilamentFabricatorManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Closure;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Str;
use Z3d0X\FilamentFabricator\Layouts\Layout;
use Z3d0X\FilamentFabricator\Models\Contracts\Page as PageContract;
Expand Down
7 changes: 3 additions & 4 deletions src/FilamentFabricatorPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Filament\Panel;
use Pboivin\FilamentPeek\FilamentPeekPlugin;
use Z3d0X\FilamentFabricator\Enums\BlockPickerStyle;
use Z3d0X\FilamentFabricator\Resources\PageResource;

class FilamentFabricatorPlugin implements Plugin
{
Expand All @@ -27,9 +26,9 @@ public function getId(): string

public function register(Panel $panel): void
{
$panel->resources([
config('filament-fabricator.page-resource') ?? PageResource::class,
]);
$panel->resources(array_filter([
config('filament-fabricator.page-resource'),
]));

if (! $panel->hasPlugin(FilamentPeekPlugin::ID)) {
//Automatically register FilamentPeekPlugin if it is not already registered
Expand Down
4 changes: 2 additions & 2 deletions src/Models/Contracts/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
use Illuminate\Database\Eloquent\Relations\HasMany;

/**
* @property-read int $id
* @property-read int|string $id
* @property-read string $title
* @property-read string $slug
* @property-read string $layout
* @property-read array $blocks
* @property-read int|null $parent_id
* @property-read int|string|null $parent_id
* @property-read \Z3d0X\FilamentFabricator\Models\Contracts\Page|null $parent
* @property-read \Illuminate\Database\Eloquent\Collection|\Z3d0X\FilamentFabricator\Models\Contracts\Page[] $children
* @property-read \Illuminate\Database\Eloquent\Collection|\Z3d0X\FilamentFabricator\Models\Contracts\Page[] $allChildren
Expand Down

0 comments on commit af0224d

Please sign in to comment.