Content pages
Editable site copy where each page has its own structure. A content page declares its own fields() (any field types — Repeater for repeating blocks, Image/Media, Editor…) and its values are stored as one JSON document per page. Extend Yurba\Cmf\Content\ContentPage and register it under pages like any custom page.
namespace App\Admin\Pages;
use Yurba\Cmf\Content\ContentPage;
use Yurba\Cmf\Fields\Editor;
use Yurba\Cmf\Fields\Image;
use Yurba\Cmf\Fields\Repeater;
use Yurba\Cmf\Fields\Text;
class HomeContent extends ContentPage
{
public function label(): string { return 'Home page'; }
public function fields(): array
{
return [
Text::make('hero_title'),
Editor::make('intro'),
Image::make('hero_bg')->dir('content'),
// repeating blocks — the whole point of per-page structure
Repeater::make('features')->columns(['title' => 'Title', 'text' => 'Text']),
];
}
}
A simple page is just Text::make('title') + Editor::make('body'); a rich one adds repeaters, images and conditional fields — same field API as resources, including ->tab('SEO') to split a long form into tabs.
use Yurba\Cmf\Content\Content;
$home = Content::get('home'); // ['hero_title' => ..., 'features' => [...]]
$title = Content::field('home', 'hero_title', 'Welcome');
// or the global shorthand (same thing), handy in Blade:
content('home', 'hero_title', 'Welcome');
Values persist to the package's yurba_content table — one JSON row per page (keyed by uriKey()). No per-field columns, so the schema is free to change.