Skip to content

Commit

Permalink
Merge pull request #13 from Sevendays-Digital/3.x
Browse files Browse the repository at this point in the history
3.x
  • Loading branch information
MichaelMdp committed Nov 13, 2023
2 parents 8b775f2 + 5013fef commit 74f3340
Show file tree
Hide file tree
Showing 11 changed files with 227 additions and 123 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@

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

## 3.0.6 Preview is now opt-in via config.
- Preview can interfere with forms configured within blocks
- Preview sets all block fields to reactive, for the 'live' preview part

By default preview is now disabled to avoid these side effects, you can enable it via config.
```php
return [
'enablePreview' => true,
];
```

- blocks with no fields can now be added

## 3.0.5 Builder update Latest
- update block-editor blade according to builder blade
- bump min version of filament to 3.0.75

## 3.0.4
- retrieve resource namespace using filament facade
- retrieve content when translation are not used in model

## 3.0.3
- change required to minimum required version of filament

## 3.0.2
- Docs updated

## 3.0.0 Initial filament v3 update
- support Filamentphp v3 / Livewire v3
- disable validation for preview
Expand Down
30 changes: 21 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# A visual page builder for Filament

[![Latest Version on Packagist](https://img.shields.io/packagist/v/haringsrob/filament-page-builder.svg?style=flat-square)](https://packagist.org/packages/haringsrob/filament-page-builder)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/haringsrob/filament-page-builder/run-tests.yml?branch=main&label=tests)](https://github.com/haringsrob/filament-page-builder/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/haringsrob/filament-page-builder/fix-php-code-style-issues.yml?branch=main&label=code%20style)](https://github.com/haringsrob/filament-page-builder/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/haringsrob/filament-page-builder.svg?style=flat-square)](https://packagist.org/packages/haringsrob/filament-page-builder)

[![Latest Version on Packagist](https://img.shields.io/packagist/v/sevendays/filament-page-builder.svg?style=flat-square)](https://packagist.org/packages/sevendays/filament-page-builder)
[![run-tests](https://github.com/Sevendays-Digital/filament-page-builder/actions/workflows/run-tests.yml/badge.svg)](https://github.com/Sevendays-Digital/filament-page-builder/actions/workflows/run-tests.yml)
[![Fix PHP code style issues](https://github.com/Sevendays-Digital/filament-page-builder/actions/workflows/fix-php-code-style-issues.yml/badge.svg)](https://github.com/Sevendays-Digital/filament-page-builder/actions/workflows/fix-php-code-style-issues.yml)[![Total Downloads](https://img.shields.io/packagist/dt/sevendays/filament-page-builder.svg?style=flat-square)](https://packagist.org/packages/sevendays/filament-page-builder)


With this package you have a new Filament field (like Builder) but with a visual ui and dynamic types.
Expand All @@ -25,7 +25,7 @@ To see a demo:
You can install the package via composer:

```bash
composer require haringsrob/filament-page-builder
composer require sevendays/filament-page-builder
```

You can publish and run the migrations with:
Expand Down Expand Up @@ -58,6 +58,18 @@ return [

Filament page builder is a custom Filament field that adds functionality on top of the Builder field.

13-11-2023 Preview is now opt-in via config.
- Preview can interfere with forms configured within blocks
- Preview sets all block fields to reactive, for the 'live' preview part

If you are ok with that, you can enable the preview via:
```php
return [
'enablePreview' => true,
];

```

To use this, create a Model and Resource as per the Filament documentation then do the following:

### 1. Generate a block
Expand Down Expand Up @@ -102,8 +114,8 @@ In order to save blocks, you need to add the Blockable interface and HasBlocks t

namespace App\Models;

use Haringsrob\FilamentPageBuilder\Models\Contracts\Blockable;
use Haringsrob\FilamentPageBuilder\Models\Traits\HasBlocks;
use Sevendays\FilamentPageBuilder\Models\Contracts\Blockable;
use Sevendays\FilamentPageBuilder\Models\Traits\HasBlocks;
use Illuminate\Database\Eloquent\Model;

class Page extends Model implements Blockable
Expand All @@ -122,7 +134,7 @@ In your resource form we can now add the field:

```php
<?php
use Haringsrob\FilamentPageBuilder\Forms\Components\BlockEditor;
use Sevendays\FilamentPageBuilder\Forms\Components\BlockEditor;
use App\Filament\Blocks\DemoBlock;

public static function form(Form $form): Form
Expand All @@ -146,7 +158,7 @@ There are not many tools for this yet but basic rendering works like this:

```php
@foreach($page->blocks as $block)
{!! \Haringsrob\FilamentPageBuilder\Facades\BlockRenderer::renderBlock($block) !!}
{!! \Sevendays\FilamentPageBuilder\Facades\BlockRenderer::renderBlock($block) !!}
@endforeach
```

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
],
"require": {
"php": "^8.1",
"filament/filament": "3.0-stable",
"filament/spatie-laravel-translatable-plugin": "^3.0-stable",
"filament/filament": "^3.0.75",
"filament/spatie-laravel-translatable-plugin": "^3.0",
"illuminate/contracts": "^9.0|^10.0",
"spatie/laravel-package-tools": "^1.13.5",
"wire-elements/modal": "^2.0"
Expand Down
2 changes: 1 addition & 1 deletion config/filament-page-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

// config for Sevendays/FilamentPageBuilder
return [

'enablePreview' => false,
];

0 comments on commit 74f3340

Please sign in to comment.