Download the PHP package effina/larastitial without Composer
On this page you can find all versions of the php package effina/larastitial. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download effina/larastitial
More information about effina/larastitial
Files in effina/larastitial
Package larastitial
Short Description A Laravel package for managing interstitials (modals, full-page redirects, inline content blocks) with configurable triggers, audience targeting, and frequency control.
License MIT
Informations about the package larastitial
Larastitial
A Laravel package for managing interstitials (modals, full-page redirects, inline content blocks) with configurable triggers, audience targeting, frequency control, and optional admin UI.
Requirements
- PHP 8.2+
- Laravel 10.x, 11.x, or 12.x
Installation
Run the install command:
Or manually publish and migrate:
Middleware Registration
The package automatically registers its middleware to the web middleware group. If auto-registration doesn't work (common in Laravel 11+), manually register it:
Laravel 11+ (bootstrap/app.php):
Laravel 10 (app/Http/Kernel.php):
To verify the middleware is registered:
Quick Start
1. Create an Interstitial
Visit /admin/interstitials to use the built-in admin UI, or create one programmatically:
2. Configure Event Listeners
In config/larastitial.php, enable the events you want to trigger interstitials:
3. Display in Your Views
For modals, add this to your layout:
For inline content:
Interstitial Types
Modal
Overlay dialogs that appear on top of the current page.
Full Page
Redirects user to a dedicated interstitial page before continuing.
Inline
Renders content within the page at named slots.
Triggers
- Event-based: Trigger on Laravel events (Login, Registered, custom events)
- Route-based: Trigger on specific routes (supports wildcards)
- Scheduled: Show only within date/time ranges
- Manual: Queue interstitials programmatically
Audience Targeting
- All users: Show to everyone
- Authenticated: Logged-in users only
- Guests: Non-authenticated visitors only
- Roles: Users with specific roles
- Custom: Implement your own condition class
Frequency Control
- Always: Show every time conditions are met
- Once: Show once per user, ever
- Once per session: Show once per browser session
- Every X days: Show again after specified days
Frontend Modes
Configure in config/larastitial.php:
Headless/API Mode
For SPAs, use the JSON API:
Using the Facade
User Model Trait
Add the trait to your User model for convenience methods:
Custom Audience Conditions
Create a class implementing AudienceCondition:
Then reference it in your interstitial's audience_condition field.
Multi-Tenancy
Enable in config:
Implement the resolver:
Testing
Use the fake for testing:
Use the factory for creating test data:
Events
Listen to these events for custom logic:
InterstitialTriggered- When an interstitial should be shownInterstitialViewed- When user sees an interstitialInterstitialDismissed- When user dismissesInterstitialCompleted- When user completes (CTA/form)InterstitialResponseSubmitted- When form is submitted
Commands
Customization
Publishing Views
Views are published to resources/views/vendor/larastitial/.
Custom Styling
The package ships with minimal, unstyled components. Publish the views and customize to match your application's design system.
License
MIT License. See LICENSE for details.
All versions of larastitial with dependencies
illuminate/contracts Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0