### Install Filament Fabricator Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/quick-win-options.md Install the Filament Fabricator package via Composer, then run the installer and publish assets. This is the first step in setting up the client's panel. ```bash composer require z3d0x/filament-fabricator ``` ```bash php artisan filament-fabricator:install ``` ```bash php artisan filament:assets ``` -------------------------------- ### Install Laravel Boost Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/example/README.md Run these commands to install Laravel Boost, which provides AI agents with tools and skills for building Laravel applications. ```bash composer require laravel/boost --dev php artisan boost:install ``` -------------------------------- ### Install and run the demo site Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/example/DEMO.md Commands to install dependencies, build the database, compile assets, and serve the site. The migrate command seeds the whole site. Use npm run dev while editing views. If public pages come up unstyled, delete public/hot. ```bash composer install php artisan migrate:fresh --seed # builds the whole site npm install && npm run build # or npm run dev while you edit views php artisan serve ``` -------------------------------- ### Install Atelier package and publish assets Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/installation.md Run these commands to install the package, publish its config and migration files, run migrations, and create the storage link. The storage link is required because uploaded images go to the public disk; without it, images in the builder and on the site are broken. ```bash composer require safi/filament-atelier php artisan vendor:publish --tag=filament-atelier-config php artisan vendor:publish --tag=filament-atelier-migrations php artisan migrate php artisan storage:link ``` -------------------------------- ### Install Filament Atelier with Composer and Artisan Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/README.md Run these commands to install the package, publish its migrations, and run migrations and storage linking. The vendor:publish command uses the tag 'filament-atelier-migrations'. ```bash composer require safi/filament-atelier php artisan vendor:publish --tag=filament-atelier-migrations php artisan migrate && php artisan storage:link ``` -------------------------------- ### Install plugin via Composer and publish assets Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/filament-plugin-development.md Commands to install the plugin package and publish its assets. Run 'composer require acme/page-builder' then 'php artisan filament:assets'. ```bash composer require acme/page-builder php artisan filament:assets ``` -------------------------------- ### Install Filament Atelier with Composer Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Home Run this command to install the package. Requires PHP 8.3+, Laravel 12/13, Filament 5, and Tailwind 4. ```bash composer require safi/filament-atelier ``` -------------------------------- ### Menu JSON structure example Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/tasks/13-menu-manager.md Example of the JSON structure for a menu, showing a location, items array, and each item with id, label (per-locale), url, target, and children. ```json { "location": "primary", "items": [ { "id": "m_1a2b", "label": { "en": "About", "ar": "من نحن" }, "url": "/about", "target": "_self", "children": [] } ] } ``` -------------------------------- ### Canonical block.json example for a notice block Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/gutenberg-block-model.md The handbook's canonical block.json example for a notice block. It shows the full metadata structure including apiVersion 3, attributes, supports, styles, variations, and script/style references. ```json { "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, "name": "my-plugin/notice", "title": "Notice", "category": "text", "parent": [ "core/group" ], "icon": "star", "description": "Shows warning, error or success notices...", "keywords": [ "alert", "message" ], "version": "1.0.3", "textdomain": "my-plugin", "attributes": { "message": { "type": "string", "source": "html", "selector": ".message" } }, "providesContext": { "my-plugin/message": "message" }, "usesContext": [ "groupId" ], "selectors": { "root": ".wp-block-my-plugin-notice" }, "supports": { "align": true }, "styles": [ { "name": "default", "label": "Default", "isDefault": true }, { "name": "other", "label": "Other" } ], "example": { "attributes": { "message": "This is a notice!" } }, "variations": [ { "name": "example", "title": "Example", "attributes": { "message": "This is an example!" } } ], "editorScript": "file:./index.js", "script": "file:./script.js", "viewScript": [ "file:./view.js", "example-shared-view-script" ], "editorStyle": "file:./index.css", "style": [ "file:./style.css", "example-shared-style" ], "viewStyle": [ "file:./view.css", "example-view-style" ], "render": "file:./render.php" } ``` -------------------------------- ### Repository layout tree Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/CLAUDE.md Shows the top-level directory layout of the repository, identifying the package root, Docs, and example app. ```text composer.json, src/, config/, database/, resources/, routes/ the package itself Docs/ the spec example/ a Laravel 13 app for testing ``` -------------------------------- ### Build editor stylesheet and publish Filament assets Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Usage Commands for developers working on the Atelier package itself, not for consumers. Rebuild the editor's own stylesheet with npm run build, then publish Filament assets from the example directory. ```bash npm run build # rebuild the editor's own stylesheet cd example && php artisan filament:assets ``` -------------------------------- ### Rebuild editor assets after plugin view changes Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/installation.md Run these commands from the repo root to rebuild the editor's own stylesheet and then refresh Filament assets in the example app. Only needed when developing the package itself, not when consuming it. ```bash npm run build # the editor's own stylesheet, from the repo root cd example && php artisan filament:assets ``` -------------------------------- ### Upgrade existing Atelier installation Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/installation.md Run these commands to update the package and re-publish migrations. New tables ship as new migration files, so re-publishing copies only new files because vendor:publish skips existing ones. Skipping this step fails late with 'no such table: atelier_...' when the feature is first used. ```bash composer update safi/filament-atelier php artisan vendor:publish --tag=filament-atelier-migrations php artisan migrate ``` -------------------------------- ### Register sitemap source in AdminPanelProvider Source: https://github.com/abdulkader-safi/filament-atelier/wiki/SEO Registers a sitemap source that returns published posts with their URLs and lastmod. This is the full example of adding blog URLs to the sitemap. ```php // app/Providers/Filament/AdminPanelProvider.php use App\Models\Post; use Safi\Atelier\AtelierPlugin; use Safi\Atelier\Blocks\DefaultBlocks; ->plugins([ AtelierPlugin::make() ->blocks(DefaultBlocks::all()) ->sitemap([ fn () => Post::published()->get()->map(fn (Post $post) => [ 'loc' => route('blog.show', $post), 'lastmod' => $post->updated_at, ]), ]), ]) ``` -------------------------------- ### Build Tailwind CSS with npm run build Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Installation Run this command after adding the @source directive to compile Tailwind CSS. It is part of the required setup for styling blocks. ```bash npm run build ``` -------------------------------- ### Implement FilamentUser to allow panel access Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Agent-quickstart In non-local environments, Filament denies panel access unless the User model implements FilamentUser. This example shows the required interface and method, with a comment to gate it properly on a real project. ```php use Filament\Models\Contracts\FilamentUser; use Filament\Panel; class User extends Authenticatable implements FilamentUser { public function canAccessPanel(Panel $panel): bool { return true; // gate this properly on a real project } } ``` -------------------------------- ### Query source example Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/gutenberg-block-model.md Defines an attribute named 'images' that pulls an array of objects, one per matched 'img' element. Each object contains 'url' and 'alt' attributes sourced from the img element's attributes. ```javascript images: { type: 'array', source: 'query', selector: 'img', query: { url: { type: 'string', source: 'attribute', attribute: 'src' }, alt: { type: 'string', source: 'attribute', attribute: 'alt' }, } } ``` -------------------------------- ### Render menu tree with MenuManager service Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/menu-manager-prior-art.md Use the MenuManager service class to fetch the menu tree for a location and render it as links. The getTree() method returns a nested array, and the example shows recursion for children. ```blade @php $tree = app(\NoteBrainsLab\FilamentMenuManager\MenuManager::class) ->menusForLocation('primary') ->first() ?->getTree() ?? []; @endphp @foreach ($tree as $item) {{ $item['title'] }} @if (!empty($item['children'])) {{-- recurse --}} @endif @endforeach ``` -------------------------------- ### Blog route definition Source: https://github.com/abdulkader-safi/filament-atelier/wiki/SEO Defines a route for a blog post using a slug, pointing to a BlogController. This is part of the worked example for adding blog URLs to the sitemap. ```php // routes/web.php Route::get('/blog/{post:slug}', [BlogController::class, 'show'])->name('blog.show'); ``` -------------------------------- ### JSON: Element settings with __globals__ references Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/elementor-architecture.md Example of element settings storing global references under __globals__ instead of literal values. The format is globals/?id=, resolved against the active Kit at render. ```json { "settings": { "title": "Add Your Heading Text Here", "__globals__": { "title_color": "globals/colors?id=primary", "typography_typography": "globals/typography?id=primary" } } } ``` -------------------------------- ### Define a custom block class (StatsBlock) Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/installation.md A block is one PHP class and one Blade view. This example shows the required methods: type(), icon(), category(), translatable(), defaults(), and schema(). Use ->live(debounce: 400) for live preview updates, and Media::upload() for images. Translatable fields are stored per locale as JSON objects. ```php namespace App\Blocks; use Filament\Forms\Components\TextInput; use Safi\Atelier\Blocks\BaseBlock; use Safi\Atelier\Media; class StatsBlock extends BaseBlock { public static function type(): string { return 'stats'; } public static function icon(): string { return 'heroicon-o-chart-bar'; } public static function category(): string { return 'Content'; } /** Fields stored per locale. */ public static function translatable(): array { return ['heading']; } /** Starting values when the block is added. */ public static function defaults(): array { return ['heading' => ['en' => 'By the numbers']]; } public function schema(): array { return [ TextInput::make('heading')->live(debounce: 400), Media::upload('image', 'Image')->live(), ]; } } ``` -------------------------------- ### Example page JSON tree structure Source: https://github.com/abdulkader-safi/filament-atelier/wiki/How-it-works Shows the JSON structure of a page as stored in Atelier. Each block has an id, type, attributes (with translated keys), and children. This is the data model that Blade renders at request time. ```json [ { "id": "b_8f3a", "type": "hero", "attributes": { "heading": { "en": "Welcome", "ar": "أهلا بك" }, "align": "center" }, "children": [] } ] ``` -------------------------------- ### Configure color supports in block.json Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/gutenberg-block-model.md Example of declaring color support in a block's supports object. Enables text and background color UI, disables background, and enables gradients. This opt-in mechanism auto-registers attributes and editor UI controls. ```javascript supports: { color: { // enables text + background color UI background: false, // ...but turn background off gradients: true // ...and enable gradients } } ``` -------------------------------- ### JSON-LD @graph for a service page with FAQ block Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Structured-data Example of the JSON-LD graph emitted by a service page at a nested slug with an FAQ block. Nodes reference each other by @id rather than repeating the organization. The scheme is fixed and derived from the URL, never stored. ```json { "@context": "https://schema.org", "@graph": [ { "@type": "ProfessionalService", "@id": "https://example.com#organization", "name": "Atelier Demo", "url": "https://example.com", "telephone": "+971 4 000 0000", "address": { "@type": "PostalAddress", "addressLocality": "Dubai", "addressCountry": "AE" }, "geo": { "@type": "GeoCoordinates", "latitude": 25.2048, "longitude": 55.2708 }, "openingHoursSpecification": [ { "@type": "OpeningHoursSpecification", "dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday"], "opens": "09:00", "closes": "18:00" } ], "contactPoint": [ { "@type": "ContactPoint", "contactType": "sales", "telephone": "+971 4 000 0000", "availableLanguage": ["Arabic", "English"] } ] }, { "@type": "WebSite", "@id": "https://example.com#website", "publisher": { "@id": "https://example.com#organization" } }, { "@type": "WebPage", "@id": "https://example.com/services/web-design#webpage", "inLanguage": "en", "isPartOf": { "@id": "https://example.com#website" }, "mainEntity": { "@id": "https://example.com/services/web-design#mainentity" } }, { "@type": "BreadcrumbList", "itemListElement": [ "…Home, Services, Web design…" ] }, { "@type": "Service", "@id": "https://example.com/services/web-design#mainentity", "provider": { "@id": "https://example.com#organization" }, "offers": { "@type": "Offer", "price": "5000", "priceCurrency": "AED" } }, { "@type": "FAQPage", "mainEntity": [ "…questions from the FAQ block…" ] } ] } ``` -------------------------------- ### Example of data JSON column structure Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Page-types Shows the shape of the data JSON column. Untranslated values are stored at data.{key}, translated values at data.{locale}.{key}. This matches the shape used by the seo column. ```json { "starting_price": 2500, "tiers": [{ "name": "Standard", "price": 450 }], "en": { "excerpt": "Sites that load fast." }, "ar": { "excerpt": "مواقع سريعة." } } ``` -------------------------------- ### Per-locale block attributes JSON example Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/prd.md Shows the JSON structure for a block with translatable attributes keyed by locale. The 'heading' attribute contains a map of locale to text, while non-translatable attributes like 'background' remain as a single value. ```json { "id": "b_8f3a", "type": "hero", "attributes": { "heading": { "en": "Welcome", "ar": "أهلا بك" }, "background": { "token": "color.primary" } } } ``` -------------------------------- ### Define custom fields with fields() and translatable() Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Page-types Use fields() to return Filament components for custom fields. The package does not inspect the component types. Use translatable() to specify which fields are translated. Translated fields get their own tabs in the settings screen. ```php use Filament\Forms\Components\FileUpload; use Filament\Forms\Components\Repeater; use Filament\Forms\Components\Textarea; use Filament\Forms\Components\TextInput; public static function fields(): array { return [ Textarea::make('excerpt')->rows(2)->columnSpanFull(), FileUpload::make('card_image') ->image() ->disk(config('atelier.media.disk')) ->visibility('public'), TextInput::make('starting_price')->numeric()->prefix('AED'), Repeater::make('tiers') ->schema([ TextInput::make('name')->required(), TextInput::make('price')->numeric()->required(), ]) ->collapsed(), ]; } public static function translatable(): array { return ['excerpt']; } ``` -------------------------------- ### PHP render_callback for dynamic Gutenberg block Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/gutenberg-block-model.md Example callback passed to register_block_type() to render a dynamic block server-side. It fetches the latest published post and returns an anchor link, or 'No posts' if none exist. The callback receives $block_attributes and $content, and returns markup similar to shortcodes. ```php function gutenberg_examples_dynamic_render_callback( $block_attributes, $content ) { $recent_posts = wp_get_recent_posts( array( 'numberposts' => 1, 'post_status' => 'publish', ) ); if ( count( $recent_posts ) === 0 ) { return 'No posts'; } $post = $recent_posts[ 0 ]; $post_id = $post['ID']; return sprintf( '%2$s', esc_url( get_permalink( $post_id ) ), esc_html( get_the_title( $post_id ) ) ); } ``` -------------------------------- ### Scoped GSAP animations with gsap.context() in Alpine component Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/preview-drafts-gsap-seo.md Best-practice scoping for SPAs. Records all animations/ScrollTriggers created inside the context so a single .revert() cleans them up. Alpine's x-init runs setup, destroy() provides teardown, and this.$el scopes selectors. ```html
...
``` -------------------------------- ### Elementor container with three widgets JSON Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/elementor-architecture.md Worked example of a container element holding three widgets (heading, image, button). Shows the shared element envelope with id, elType, widgetType, settings, and elements. Settings store control values keyed by control id; unit/dimension values are objects (e.g., _padding with unit, top, right, bottom, left, isLinked). ```json { "title": "About Page", "type": "page", "version": "0.4", "content": [ { "id": "6af611eb", "elType": "container", "settings": [], "elements": [ { "id": "6a637978", "elType": "widget", "widgetType": "heading", "settings": { "title": "Add Your Heading Text Here", "align": "center" }, "elements": [] }, { "id": "687dba89", "elType": "widget", "widgetType": "image", "settings": { "_padding": { "unit": "px", "top": "100", "right": "0", "bottom": "100", "left": "0", "isLinked": false } }, "elements": [] }, { "id": "6f58bb5", "elType": "widget", "widgetType": "button", "settings": { "text": "Click Me", "button_text_color": "#000000", "background_color": "#E7DFF5" }, "elements": [] } ] } ] } ``` -------------------------------- ### Define starter sections with template() Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Page-types Returns an array of block types that pre-populate a new page of this type. Each block carries its own defaults; override per-node with an 'attributes' key. ```php public static function template(): array { return [ ['type' => 'hero'], ['type' => 'features'], ['type' => 'cta'], ]; } ``` -------------------------------- ### Publish config, migrations, migrate, and link storage Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Installation Run these commands to publish the package configuration and migrations, run the migrations, and create the storage symlink. The storage:link command is not optional; without it, uploaded images will be broken. ```bash php artisan vendor:publish --tag=filament-atelier-config php artisan vendor:publish --tag=filament-atelier-migrations php artisan migrate php artisan storage:link ``` -------------------------------- ### Get media URL in Blade view Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Troubleshooting Use this Blade snippet to safely get a media URL from an image attribute. It handles cases where the attribute is null or an array, avoiding direct Storage::url() calls. ```blade @php $src = \Safi\Atelier\Media::url($attributes['image'] ?? null); @endphp ``` -------------------------------- ### Publish and run Atelier migrations Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Troubleshooting Run these commands to publish and run the new migration files when an upgrade adds a table like `atelier_page_revisions` or `_redirects`. New tables ship as new migration files, so this is safe and copies only what is new. ```bash php artisan vendor:publish --tag=filament-atelier-migrations php artisan migrate ``` -------------------------------- ### Opt into shared controls with supports() Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Blocks Return an array of supported control keys from the supports() method. The block opts into controls it does not have to build. Supported keys are 'background' and 'padding'. Controls emit inline styles from tokens, not utility classes. Leaving a control unset changes nothing. ```php public static function supports(): array { return ['background', 'padding']; } ``` -------------------------------- ### Set preview widths in config Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Configuration Define fixed pixel widths for preview breakpoints. Null means unconstrained for desktop. ```php 'widths' => [ 'desktop' => null, // null means unconstrained 'tablet' => 820, 'mobile' => 390, ], ``` -------------------------------- ### Verify routes exist Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Agent-quickstart First verification step. Expect the preview route, editor page, Pages resource, and public page routes. ```bash # 1. Routes exist php artisan route:list | grep -E 'atelier|pages' ``` -------------------------------- ### Using a token directly in CSS Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Design-tokens Use this when the block always uses the token value. The example shows a section with padding-block set to the --atelier-space-section token. ```blade
class(['px-6']) }} style="padding-block: var(--atelier-space-section)"> ``` -------------------------------- ### Seed Demo Data with Tinker Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Agent-quickstart Run this artisan tinker command to execute the AtelierDemoSeeder and populate the database with demo content for immediate viewing. ```bash php artisan tinker --execute='(new Safi\Atelier\Database\Seeders\AtelierDemoSeeder)->run();' ``` -------------------------------- ### Attribute source example Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/gutenberg-block-model.md Defines an attribute named 'url' that pulls the 'src' attribute from an 'img' element. This is used when data is stored in an HTML element attribute. ```javascript url: { type: 'string', source: 'attribute', selector: 'img', attribute: 'src', } ``` -------------------------------- ### Publish the atelier config file Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Configuration Run this artisan command to publish the config/atelier.php file. Publishing is optional because every key has a working default; republishing after an upgrade never overwrites your existing file. ```bash php artisan vendor:publish --tag=filament-atelier-config ``` -------------------------------- ### HTML source example Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/gutenberg-block-model.md Defines an attribute named 'content' that pulls the inner HTML of a 'figcaption' element. This is typically used by RichText to store rich text content. ```javascript content: { type: 'string', source: 'html', selector: 'figcaption', } ``` -------------------------------- ### Run Atelier demo seeder Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/installation.md Seeds demo content (Home, About, and a draft Contact) so you can see the CMS working. Delete these pages once you have real content. ```php (new Safi\Atelier\Database\Seeders\AtelierDemoSeeder)->run(); ``` -------------------------------- ### Enable experimental menus in config/atelier.php Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/README.md Configuration snippet to enable the experimental menu manager globally. Set 'menus' => true under the 'experimental' key. Off by default; leaving it off removes the page and its route from the panel entirely. ```php // config/atelier.php 'experimental' => [ 'menus' => true, ], ``` -------------------------------- ### Find Panel Provider File Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Agent-quickstart Use grep to locate the file that extends PanelProvider in the app/Providers directory, as the plugin registration must be added there. ```bash grep -rl 'extends PanelProvider' app/Providers ``` -------------------------------- ### Implement Filament\Contracts\Plugin with getId, register, boot Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/filament-plugin-development.md Defines the main plugin class implementing the Filament Plugin contract. Required methods: getId(), register(Panel $panel), boot(Panel $panel). The register method adds resources and pages to the panel. ```php namespace Acme\PageBuilder; use Filament\Contracts\Plugin; use Filament\Panel; class PageBuilderPlugin implements Plugin { public static function make(): static { return app(static::class); } public function getId(): string { return 'page-builder'; } public function register(Panel $panel): void { $panel ->resources([PageResource::class]) ->pages([VisualBuilder::class]); } public function boot(Panel $panel): void { // } } ``` -------------------------------- ### Implement MenuSource on an Eloquent model Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Menus Implements the MenuSource interface on a Post model, providing the required static methods for the picker and instance methods for the menu label and URL. The menuSourceOptions method returns an id-to-label array ordered by title. The label and URL are copied once at pick time, not kept as a live reference. ```php use Safi\Atelier\MenuSource; class Post extends Model implements MenuSource { public static function menuSourceLabel(): string { return 'Post'; } /** @return array id to label, for the picker */ public static function menuSourceOptions(): array { return static::query()->orderBy('title')->pluck('title', 'id')->all(); } public static function menuSourceFind(int|string $id): ?static { return static::query()->find($id); } public function getMenuLabel(): string { return $this->title; } public function getMenuUrl(): string { return route('posts.show', $this); } } ``` ```php AtelierPlugin::make()->menuSources([Post::class]) ``` -------------------------------- ### Serve index listing with indexView() Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Page-types Declares a view that serves a listing at the prefix root. The view receives $pages, $type, and $locale, and renders inside your configured layout. ```php public static function indexView(): ?string { return 'services.index'; } ``` -------------------------------- ### Verify public page renders server-side Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Agent-quickstart Second verification step. Expect the number of sections, not 0. If 0, either no page is published or the welcome route is still winning. ```bash # 2. The public page renders, server-side curl -s http://localhost:8000/ | grep -c 'data-atelier-block' ``` -------------------------------- ### Block comment delimiter with JSON attributes Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/gutenberg-block-model.md Example of a block comment delimiter containing JSON attributes for title and size, while the url attribute is sourced from the img element. This shows how attributes without a source are stored in the comment delimiter. ```html ``` -------------------------------- ### Verify content is in initial HTML Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Agent-quickstart Third verification step. The heading must be in the source, not injected later. This is the whole SEO argument. ```bash # 3. Content is in the initial HTML, with no JavaScript curl -s http://localhost:8000/ | grep -oE ']*>[^<]*' ``` -------------------------------- ### JS initializer mapping presets to GSAP recipes Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/preview-drafts-gsap-seo.md A single initializer (run on livewire:navigated) reads [data-anim] and maps each preset name to a GSAP recipe. Non-technical users pick from a dropdown; new presets are added in this map. ```javascript const PRESETS = { 'fade-up': () => ({ from: { opacity:0, y:40 } }), 'fade-in': () => ({ from: { opacity:0 } }), 'zoom-in': () => ({ from: { opacity:0, scale:0.9 } }), 'slide-left': () => ({ from: { opacity:0, x:60 } }), }; function initAnimations() { gsap.utils.toArray('[data-anim]').forEach(el => { const recipe = PRESETS[el.dataset.anim]; if (!recipe) return; gsap.from(el, { ...recipe().from, duration: +el.dataset.animDuration || 0.8, scrollTrigger: { trigger: el, start: 'top 80%' } }); }); } ``` -------------------------------- ### Check Tailwind @source by grepping built CSS Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Agent-quickstart Run this command to verify the Tailwind @source line is present. If the output is 0, blocks render unstyled with no error. ```bash grep -c 'text-pretty' public/build/assets/app-*.css ``` -------------------------------- ### Expose Livewire method to Alpine with #[ExposedLivewireMethod] Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/filament-plugin-development.md PHP method marked as exposed and renderless, callable from Alpine via $wire.callSchemaComponentMethod. Only methods with this attribute are callable for security. ```php use Filament\Support\Components\Attributes\ExposedLivewireMethod; use Livewire\Attributes\Renderless; #[ExposedLivewireMethod] #[Renderless] public function snapToGrid(array $coords): array { /* ... */ } ``` -------------------------------- ### Blade view for a page type card Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/installation.md A Blade partial that receives $page and $locale. It uses $page->url($locale) for the link, $page->title for the title, and $page->data('excerpt', $locale) for translated data. The example shows formatting a numeric value with number_format. ```blade {{-- resources/views/services/card.blade.php, given $page and $locale --}}

{{ $page->title }}

{{ $page->data('excerpt', $locale) }}

From AED {{ number_format((float) $page->data('starting_price')) }}

``` -------------------------------- ### Verify Atelier routes with route:list Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Installation Lists routes filtered by 'atelier' to confirm the preview route, editor page, and public page routes are registered. If the preview iframe is blank or unstyled, check step 4 and whether a stale public/hot file points Vite at a non-running dev server. ```bash php artisan route:list | grep atelier ``` -------------------------------- ### Generate signed preview URL and route with middleware Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/preview-drafts-gsap-seo.md Creates a temporary signed URL for a page preview that expires in 30 minutes. The route uses the 'signed' middleware to reject tampered or expired links with a 403. Use temporarySignedRoute over signedRoute to ensure links expire. ```php $url = URL::temporarySignedRoute('pages.preview', now()->addMinutes(30), ['page' => $page->id]); // routes/web.php Route::get('/preview/{page}', PreviewController::class) ->name('pages.preview') ->middleware('signed'); ``` -------------------------------- ### Generate a custom Filament page with artisan Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/filament-plugin-development.md Run this command to scaffold a new custom page class. The generated file will be placed in the Filament pages directory. ```bash php artisan make:filament-page VisualBuilder ``` -------------------------------- ### Short form sitemap source Source: https://github.com/abdulkader-safi/filament-atelier/wiki/SEO Returns a list of plain URL strings for fixed routes. Suitable for a handful of static URLs. ```php ->sitemap([ fn () => [ route('pricing'), route('contact'), ], ]) ``` -------------------------------- ### Create and publish a page from code Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Publishing Creates a Page with draft content, sets slugs for English and Arabic, and publishes it. Useful for seeders or standing up a client site. setSlugs() generates a slug from the title when passed an empty string and writes a 301 from the old URL on slug changes. ```php use Safi\Atelier\Models\Page; $page = Page::create([ 'title' => 'Pricing', 'draft_content' => [[ 'id' => 'b_hero', 'type' => 'hero', 'attributes' => ['heading' => ['en' => 'Pricing', 'ar' => 'الأسعار']], 'children' => [], ]], ]); $page->setSlugs(['en' => 'pricing', 'ar' => 'as3ar']); $page->publish(); ``` -------------------------------- ### Enable experimental menus per panel with AtelierPlugin::make()->experimental() Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/README.md Per-panel override to enable the experimental menu manager. This overrides the config setting. Use AtelierPlugin::make()->experimental(['menus' => true]). ```php AtelierPlugin::make()->experimental(['menus' => true]) ``` -------------------------------- ### Publish Atelier Blade views Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Configuration Run this artisan command to copy all package Blade views into resources/views/vendor/atelier/. After publishing, rebuild your CSS because the @source line pointing at the vendor directory no longer covers the published views. ```bash php artisan vendor:publish --tag=filament-atelier-views ``` -------------------------------- ### Register layouts with AtelierPlugin Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Layouts Shows how to register layouts using the AtelierPlugin's layouts method. The long form takes 'label', 'view', and optional 'description'; the short form is just the view name, with the label derived from the key. Registering layouts does not force every page to pick one; empty means the site-wide 'atelier.layout'. ```php use Safi\Atelier\AtelierPlugin; use Safi\Atelier\Blocks\DefaultBlocks; ->plugins([ AtelierPlugin::make() ->blocks(DefaultBlocks::all()) ->layouts([ 'site' => [ 'label' => 'Navbar and footer', 'view' => 'layouts.site', 'description' => 'The marketing shell. Full-width sections.', ], 'docs' => [ 'label' => 'Sidebar', 'view' => 'layouts.docs', ], 'bare' => 'layouts.bare', ]), ]) ``` -------------------------------- ### Register Atelier plugin in panel provider Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/installation.md Add this to your panel provider's plugins array to register the Atelier plugin with the default blocks. DefaultBlocks::all() is the set Atelier ships; pass your own array to cherry-pick blocks or add custom classes. ```php use Safi\Atelier\AtelierPlugin; use Safi\Atelier\Blocks\DefaultBlocks; ->plugins([ AtelierPlugin::make() ->blocks(DefaultBlocks::all()), ]) ``` -------------------------------- ### Enable experimental features in config Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Configuration Configuration array to enable experimental features. The 'menus' flag is off by default and can be overridden per panel with AtelierPlugin::make()->experimental(['menus' => true]). ```php 'experimental' => [ 'menus' => false, ], ``` -------------------------------- ### Register Atelier components in panel provider Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Configuration Use AtelierPlugin::make() in your panel provider to register block types, layout shells, and extra sitemap URLs. Blocks and layouts are code-based, while sitemap URLs come from external sources. ```php AtelierPlugin::make() ->blocks(DefaultBlocks::all()) // block types ->layouts([...]) // shells a page can pick ->sitemap([...]); // URLs from outside Atelier ``` -------------------------------- ### Include package menu partial Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Menus Fastest way to render a menu using the package's Blade partial. Pass the location and locale. The partial outputs bare markup with nested lists and aria-current attributes. ```blade @include('atelier::partials.menu', ['location' => 'primary', 'locale' => $locale]) ``` -------------------------------- ### Create storage symlink for public disk Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Configuration Required when using the default public disk. Without the symlink, images in the builder and live site are broken with no log entry. ```bash php artisan storage:link ``` -------------------------------- ### Call exposed Livewire method from Alpine Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/filament-plugin-development.md JavaScript call to the exposed snapToGrid method using $wire.callSchemaComponentMethod with the field key and parameters. ```js this.result = await $wire.callSchemaComponentMethod(@js($getKey()), 'snapToGrid', { coords }) ``` -------------------------------- ### Verify SEO tags Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Agent-quickstart Sixth verification step. Expect title, canonical link, and og:title tags. ```bash # 6. SEO tags curl -s http://localhost:8000/ | grep -oE '[^<]*|<link rel="canonical"[^>]*|og:title[^>]*' ``` -------------------------------- ### Register plugin assets with FilamentAsset Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/filament-plugin-development.md Register CSS, JS, and Alpine components in a service provider's boot() or packageBooted() method. Use the package: parameter to place assets under a per-plugin subdirectory when running php artisan filament:assets. The Css and Js assets are auto-loaded on every Filament page unless ->loadedOnRequest() is used. ```php use Filament\Support\Facades\FilamentAsset; use Filament\Support\Assets\Js; use Filament\Support\Assets\Css; use Filament\Support\Assets\AlpineComponent; FilamentAsset::register([ Css::make('page-builder-styles', __DIR__ . '/../resources/css/builder.css'), Js::make('page-builder', __DIR__ . '/../resources/dist/builder.js'), AlpineComponent::make('visual-canvas', __DIR__ . '/../resources/dist/visual-canvas.js'), ], package: 'acme/page-builder'); ``` -------------------------------- ### Verify a draft does not leak Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Agent-quickstart Fourth verification step. Expect 404. The demo seeder leaves Contact as a draft on purpose. ```bash # 4. A draft does not leak curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8000/contact ``` -------------------------------- ### Minimal render.php for dynamic block Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/gutenberg-block-model.md PHP file used to render the block on the server for the front end. Receives $attributes, $content, and $block. Uses get_block_wrapper_attributes() and escapes the label attribute. ```php <div <?php echo get_block_wrapper_attributes(); ?>> <?php echo esc_html( $attributes['label'] ); ?> </div> ``` -------------------------------- ### Single locale configuration Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Multi-language-and-RTL Valid configuration with one locale. The language switcher hides and URLs are unprefixed. ```php 'locales' => [ 'en' => ['label' => 'English', 'dir' => 'ltr'], ], ``` -------------------------------- ### Register AtelierPlugin with blocks (standalone) Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Troubleshooting This snippet shows the plugin registration with blocks. If the section picker is empty, verify that blocks are actually passed; an empty array registers nothing. ```php AtelierPlugin::make()->blocks(DefaultBlocks::all()) ``` -------------------------------- ### Verify other locale with RTL and hreflang Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Agent-quickstart Fifth verification step. Expect dir="rtl", lang="ar", and hreflang for both locales. ```bash # 5. The other locale, with RTL and hreflang curl -s http://localhost:8000/ar/home | grep -oE '<html[^>]*|hreflang="[a-z]+"' ``` -------------------------------- ### robots.txt content Source: https://github.com/abdulkader-safi/filament-atelier/wiki/SEO The robots.txt file served at /robots.txt, disallowing the preview route and the panel, and pointing to the sitemap. The panel path can be configured with atelier.robots.disallow_panel, or set to null to leave it crawlable. Note: Laravel ships a real public/robots.txt that takes precedence over this route. ```text User-agent: * Disallow: /atelier/preview/ Disallow: /admin/ Sitemap: https://example.com/sitemap.xml ``` -------------------------------- ### Use Tokens API methods Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Design-tokens Provides the main methods for accessing design tokens: all(), css(), value(), options(), and resolve(). Tokens::value() returns null for undefined keys instead of emitting a variable. ```php use Safi\Atelier\Tokens; Tokens::all(); // the merged set, defaults plus your overrides Tokens::css(); // the :root block, as a string Tokens::value('color.primary'); // 'var(--atelier-color-primary)', or null if unknown Tokens::options('color'); // ['color.primary' => 'Primary', ...] for a Select Tokens::resolve(['token' => '...']); // reference to CSS value, anything else passes through ``` -------------------------------- ### Register menu locations in config/atelier.php Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Menus Define menu locations (primary, footer, sidebar) with labels and optional depth. Depth controls nesting levels; default is 1, 0 makes it flat. The editor and public partial only support one level regardless of higher values. ```php // config/atelier.php, next to locales 'menus' => [ 'primary' => ['label' => 'Primary'], 'footer' => ['label' => 'Footer'], 'sidebar' => ['label' => 'Sidebar', 'depth' => 0], ], ``` -------------------------------- ### BasePageType::template() Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Page-types Returns the block tree a new page of this kind opens with. ```APIDOC ## BasePageType::template() ### Description Returns the block tree a new page of this kind opens with. ### Method `public static function template(): array` ### Returns - **array** - The block tree. ### Example ```php public static function template(): array { return [ 'blocks' => [ ['type' => 'heading', 'data' => ['text' => 'Welcome']], ], ]; } ``` ``` -------------------------------- ### Multiple locales configuration with RTL Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Multi-language-and-RTL Configuration for multiple locales including Arabic with RTL direction. The first locale is default and lives at /{slug}; others at /{locale}/{slug}. ```php 'locales' => [ 'en' => ['label' => 'English', 'dir' => 'ltr'], 'fr' => ['label' => 'Français', 'dir' => 'ltr'], 'ar' => ['label' => 'العربية', 'dir' => 'rtl'], ], ``` -------------------------------- ### Configure locales in config/atelier.php Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/installation.md Defines the supported locales. The first locale is the default and lives at /{slug}; others live at /{locale}/{slug}. Changing this after pages exist requires migrating per-locale maps in every block tree. For English-only sites, delete the Arabic line. ```php 'locales' => [ 'en' => ['label' => 'English', 'dir' => 'ltr'], 'ar' => ['label' => 'العربية', 'dir' => 'rtl'], ], ``` -------------------------------- ### PHP: Add control with selectors map Source: https://github.com/abdulkader-safi/filament-atelier/blob/main/Docs/research/elementor-architecture.md Shows how to declare a color control with a selectors map using tokens {{WRAPPER}} and {{VALUE}}. This pattern is used to generate scoped CSS per element instance. ```php $this->add_control( 'color', [ 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} h3' => 'color: {{VALUE}}' ], ] ); ``` -------------------------------- ### Include tokens partial in custom layout Source: https://github.com/abdulkader-safi/filament-atelier/wiki/Design-tokens Shows how to include the tokens partial after your stylesheet so custom properties win. If omitted, nothing errors but var(--atelier-*) resolves to nothing, breaking background and spacing controls and RTL font stacks. ```blade @vite(['resources/css/app.css']) @include('atelier::partials.tokens') ```