Skip to main content

Page Designer

super-admin-org/page-designer adds a pagedesigner form field: a canvas where editors place blocks (text, images, video, inline galleries, embeds) freely, resize them on a snap grid, and edit each block's content. A front-end route renders the saved layout.

Packagesuper-admin-org/page-designer
Adds$form->pagedesigner('data')
MenuPage Designer
Permissionext.page-designer (path /page-designer*)
Depends onCKEditor (for text blocks)
Read before installing
  • The admin pages come from example controllers that you publish into your application and route yourself (steps below). Until your route exists, /admin/page-designer shows a checklist of the remaining steps (2.0+).
  • Publishing writes into app/Admin/Controllers, app/Admin/Traits, app/Http/Controllers, app/Models, database/migrations and resources/views. Run it on a clean Git working tree so you can review the result.
  • It depends on the CKEditor extension; read its licensing note.
  • Releases 1.x registered /admin/page-designer to a controller the package did not contain, which also broke php artisan route:list, and published the example into an App/ folder in the project root. Use 2.0 or newer.

Installation​

composer require super-admin-org/page-designer
php artisan admin:import page-designer
php artisan vendor:publish --tag=page-designer # assets + example controllers, models, migrations, views
php artisan migrate

Publish them separately with --tag=page-designer-assets and --tag=page-designer-example (2.0+).

Add the admin routes to app/Admin/routes.php:

$router->resource('page-designer', PageDesignerController::class);
$router->resource('page-designer-images', PageDesignerImagesController::class);
$router->resource('page-designer-videos', PageDesignerVideoController::class);
$router->resource('page-designer-texts', PageDesignerTextController::class);
$router->resource('page-designer-inline-galleries', PageDesignerInlineGalleryController::class);
$router->resource('page-designer-embeds', PageDesignerEmbedController::class);

and the front-end route to routes/web.php:

use App\Http\Controllers\PageDesignerController;

Route::get('/page/{id}', [PageDesignerController::class, 'index'])->name('page-designer');

Usage​

In a form:

$form->pagedesigner('data', __('Page design'));

// Snap grid in pixels (default 40)
$form->pagedesigner('data')->snap(30);

Open /page/{id} to see the rendered page; change its look in resources/views/page_designer.blade.php.

Adding block types​

The designer scans the admin controllers (admin.route.namespace, default App\Admin\Controllers) for classes that use the PageDesignItem trait. Generate an admin controller for your model (the Helpers scaffold does this), add the trait and describe the block in pageDesign(); the published example controllers show the expected keys (type, model, parent_field, title, icon, optional path).

To list the block controllers yourself instead of scanning (2.0+):

'extensions' => [
'page-designer' => [
'item_controllers' => [
App\Admin\Controllers\PageDesignerTextController::class,
App\Admin\Controllers\PageDesignerImagesController::class,
],
],
],

Compatibility​

LaravelPHPState
8 – 138.0+Works after the example is published and the routes are added.

The class PageDesignerExtention was renamed PageDesignerExtension in 2.0; the old name still works.