phillipsharring / handlr-module-landing
Landing page module for handlr apps -- email capture and coming-soon page
Package info
github.com/phillipsharring/handlr-module-landing
pkg:composer/phillipsharring/handlr-module-landing
Requires
- php: >=8.4
- phillipsharring/handlr-framework: ^0.5
README
Landing page module for handlr/graspr apps. Provides a "coming soon" email capture page and admin list.
Install
composer require phillipsharring/handlr-module-landing
One package. Composer installs both the PHP backend (service provider, handlers, migration) and the frontend assets (pages, components, JS module definition).
Setup
Two lines to connect:
1. Register the service provider in backend/app/config.php:
'providers' => [ // ... Handlr\Module\Landing\LandingServiceProvider::class, ],
2. Register the frontend module in frontend/site.config.js:
import { landing } from '../backend/vendor/phillipsharring/handlr-module-landing/src/index.js'; export default { // ... modules: [landing], };
3. Run the migration to create the email_captures table:
composer run migrate
What's included
Backend
POST /api/public/email-capture-- captures an email address (public, no auth required)GET /api/admin/email-captures-- lists all captured emails (admin only)email_capturestable migration (auto-discovered viamigrationPaths())
Frontend
/landing/page with email capture form- Module object with self-resolving
pagesDirandcomponentsDirfor graspr-build
Configuration
Override defaults with configure() from @phillipsharring/graspr-build:
import { configure } from '@phillipsharring/graspr-build/modules'; import { landing } from '../backend/vendor/phillipsharring/handlr-module-landing/src/index.js'; export default { modules: [ configure(landing, { adminNav: false }), ], };
Removal
- Remove
LandingServiceProvider::classfromconfig.php - Remove the
landingimport and entry fromsite.config.js composer remove phillipsharring/handlr-module-landing- Roll back the migration (or drop the
email_capturestable)
Requires
phillipsharring/handlr-framework>= 0.5@phillipsharring/graspr-build>= 0.3.0 (for module support in the build system)
