PHPackages                             programmernomad/laracorekit-demo-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. programmernomad/laracorekit-demo-module

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

programmernomad/laracorekit-demo-module
=======================================

Auto-resetting demo environment for Laravel applications with Filament integration

014PHP

Since Dec 16Pushed 4mo agoCompare

[ Source](https://github.com/ProgrammerNomad/laracorekit-demo-module)[ Packagist](https://packagist.org/packages/programmernomad/laracorekit-demo-module)[ RSS](/packages/programmernomad-laracorekit-demo-module/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

LaraCoreKit Demo Module
=======================

[](#laracorekit-demo-module)

Auto-resetting demo environment for Laravel applications with Filament integration. Perfect for showcasing your Laravel projects with automatic database resets every 30 minutes.

[![Latest Version on Packagist](https://camo.githubusercontent.com/7b1de443e86f0a89f39e3646f409a110d95174b6847f50b74e5874eec189cede/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70726f6772616d6d65726e6f6d61642f6c617261636f72656b69742d64656d6f2d6d6f64756c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/programmernomad/laracorekit-demo-module)[![Total Downloads](https://camo.githubusercontent.com/de7f9098cb124286a955665ed1fc0d2bd096db2f30738dae7adb25baaa179b77/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70726f6772616d6d65726e6f6d61642f6c617261636f72656b69742d64656d6f2d6d6f64756c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/programmernomad/laracorekit-demo-module)[![License](https://camo.githubusercontent.com/e3b8d79b04144edcad914aa92378b604be63850ce2dc2d163e4c5ff918f649d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f70726f6772616d6d65726e6f6d61642f6c617261636f72656b69742d64656d6f2d6d6f64756c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/programmernomad/laracorekit-demo-module)

Features
--------

[](#features)

- ✅ **Auto-Reset Database**: Automatically fresh migrate + seed every 30 minutes (configurable)
- ✅ **Demo Credentials Banner**: Show login credentials on auth pages and admin dashboard
- ✅ **Filament Integration**: Beautiful admin widgets displaying demo info
- ✅ **Action Blocking**: Prevent destructive operations (user deletion, critical settings)
- ✅ **Media Cleanup**: Auto-delete uploaded files on reset
- ✅ **Session &amp; Cache Clear**: Clean state on every reset
- ✅ **Security**: Domain whitelisting, production safeguards
- ✅ **Cron Scheduling**: Integrated with Laravel scheduler
- ✅ **Customizable**: Full control over reset interval, credentials, blocked actions

Use Cases
---------

[](#use-cases)

- 🎭 **Demo Websites**: Show off your Laravel/Filament projects
- 🧪 **Testing Environments**: Auto-reset sandbox for testers
- 🎓 **Training Platforms**: Clean state for each training session
- 🚀 **SaaS Trials**: Let users try your app without permanent changes

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Laravel 11.0 or 12.0
- Filament 3.0 (optional, for admin widgets)

Installation
------------

[](#installation)

Install via Composer:

```
composer require programmernomad/laracorekit-demo-module
```

The package will automatically register via Laravel's package auto-discovery.

Configuration
-------------

[](#configuration)

### Step 1: Publish Configuration

[](#step-1-publish-configuration)

```
php artisan vendor:publish --tag=demo-config
```

This creates `config/demo.php` with all available options.

### Step 2: Update `.env`

[](#step-2-update-env)

Add these variables to your `.env` file:

```
# Demo Mode Configuration
DEMO_MODE=true
DEMO_RESET_INTERVAL=30

# Demo Credentials (shown on login pages)
DEMO_ADMIN_EMAIL=admin@demo.test
DEMO_ADMIN_PASSWORD=Admin@123
DEMO_USER_EMAIL=user@demo.test
DEMO_USER_PASSWORD=User@123
```

### Step 3: Setup Cron Job

[](#step-3-setup-cron-job)

The module uses Laravel's task scheduler. Add this to your server's crontab:

```
* * * * * cd /path/to/your/project && php artisan schedule:run >> /dev/null 2>&1
```

**For Plesk Control Panel:**

1. Go to **Scheduled Tasks (Cron Jobs)**
2. Add new task with command:

```
cd /var/www/vhosts/yourdomain.com && php artisan schedule:run >> /dev/null 2>&1
```

3. Run: Every minute

Usage
-----

[](#usage)

### Enable Demo Mode

[](#enable-demo-mode)

Simply set in your `.env`:

```
DEMO_MODE=true
```

The module will:

- Show demo credentials on login pages
- Display admin dashboard banner with credentials
- Block destructive actions
- Auto-reset database every 30 minutes

### Manual Database Reset

[](#manual-database-reset)

Force an immediate reset:

```
php artisan demo:reset
```

With confirmation prompt:

```
php artisan demo:reset --force
```

### Disable Demo Mode

[](#disable-demo-mode)

Set in `.env`:

```
DEMO_MODE=false
```

All demo features are disabled. No overhead.

Customization
-------------

[](#customization)

### Change Reset Interval

[](#change-reset-interval)

In `config/demo.php` or `.env`:

```
# Reset every 60 minutes instead of 30
DEMO_RESET_INTERVAL=60
```

### Add Custom Blocked Actions

[](#add-custom-blocked-actions)

In `config/demo.php`:

```
'blocked_actions' => [
    'user.delete',
    'user.force-delete',
    'role.delete',
    'backup.run',
    'your-custom-action', // Add your own
],
```

### Customize Banner Appearance

[](#customize-banner-appearance)

In `config/demo.php`:

```
'banner' => [
    'show_on_login' => true,
    'show_on_admin' => true,
    'background_color' => 'yellow-50',
    'border_color' => 'yellow-500',
    'text_color' => 'yellow-900',
],
```

### Domain Whitelisting (Security)

[](#domain-whitelisting-security)

Only allow demo mode on specific domains:

```
'allowed_hosts' => [
    'demo.yourdomain.com',
    'localhost',
    '127.0.0.1',
],
```

Integration with Filament
-------------------------

[](#integration-with-filament)

### Display Demo Banner in Admin Dashboard

[](#display-demo-banner-in-admin-dashboard)

The module automatically registers a Filament widget. To display it:

**Option 1: In Dashboard Page**

```
use LaraCoreKit\DemoModule\Filament\Widgets\DemoBannerWidget;

class Dashboard extends Page
{
    protected function getHeaderWidgets(): array
    {
        return [
            DemoBannerWidget::class,
        ];
    }
}
```

**Option 2: In Custom Filament Page**

```
use LaraCoreKit\DemoModule\Filament\Widgets\DemoBannerWidget;

protected function getHeaderWidgets(): array
{
    return [
        DemoBannerWidget::class,
    ];
}
```

The widget will only show when `DEMO_MODE=true`.

UI Integration
--------------

[](#ui-integration)

**See [UI\_INTEGRATION\_GUIDE.md](UI_INTEGRATION_GUIDE.md) for complete integration examples.**

### Quick Start

[](#quick-start)

**Frontend Login:**

```

```

**Filament Admin Login:**

```
# Windows PowerShell
Copy-Item "vendor\programmernomad\laracorekit-demo-module\stubs\filament-login.blade.php" `
         -Destination "resources\views\filament\pages\auth\login.blade.php"
```

Blade Components
----------------

[](#blade-components)

### Login Page Banner

[](#login-page-banner)

Add to your login view:

```

```

For admin login:

```

```

This displays credentials when demo mode is active.

Security Features
-----------------

[](#security-features)

### Domain Validation

[](#domain-validation)

In production, demo mode only works on whitelisted domains (configured in `config/demo.php`).

### Action Blocking

[](#action-blocking)

Destructive actions are automatically blocked via Laravel Gates:

```
// Example: This will be denied in demo mode
Gate::allows('user.delete'); // returns false
```

### Middleware Protection

[](#middleware-protection)

Apply middleware to routes that should block actions:

```
Route::middleware('demo.block')->group(function () {
    // Protected routes
});
```

What Gets Reset?
----------------

[](#what-gets-reset)

Every reset cycle cleans:

- ✅ **Database**: Fresh migrations + seeders
- ✅ **Media Files**: `storage/app/public/media/*`
- ✅ **Cache**: All cached data
- ✅ **Sessions**: Active user sessions
- ✅ **Logs**: Rotated (keeps last 7 days)

**Preserved:**

- ✅ `.env` configuration
- ✅ Compiled assets (`public/build/*`)
- ✅ Vendor packages
- ✅ Node modules

Troubleshooting
---------------

[](#troubleshooting)

### Cron Not Running

[](#cron-not-running)

Check if Laravel scheduler is working:

```
php artisan schedule:list
```

You should see `demo:reset` scheduled.

### Demo Banner Not Showing

[](#demo-banner-not-showing)

Clear config cache:

```
php artisan config:clear
php artisan view:clear
```

Verify `.env`:

```
php artisan tinker
>>> config('demo.enabled') // Should return true
```

### Reset Fails

[](#reset-fails)

Check logs:

```
tail -f storage/logs/laravel.log
```

Run manually with verbose output:

```
php artisan demo:reset --force -vvv
```

### Media Files Not Deleting

[](#media-files-not-deleting)

Check permissions:

```
ls -la storage/app/public/media/
chmod -R 775 storage/app/public/media/
```

Development
-----------

[](#development)

### Local Development

[](#local-development)

Clone and link locally:

```
# Clone repo
git clone https://github.com/programmernomad/laracorekit-demo-module.git

# In your Laravel project's composer.json
{
    "repositories": [
        {
            "type": "path",
            "url": "../aracorekit-demo-module",
            "options": {
                "symlink": true
            }
        }
    ],
    "require-dev": {
        "programmernomad/laracorekit-demo-module": "@dev"
    }
}

# Install
composer update programmernomad/laracorekit-demo-module
```

### Testing

[](#testing)

```
# Run package tests
composer test

# Code style (Laravel Pint)
composer pint
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG.md](CHANGELOG.md) for recent changes.

Contributing
------------

[](#contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [ProgrammerNomad](https://github.com/ProgrammerNomad)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

Support
-------

[](#support)

- **Issues**: [GitHub Issues](https://github.com/programmernomad/laracorekit-demo-module/issues)
- **Discussions**: [GitHub Discussions](https://github.com/programmernomad/laracorekit-demo-module/discussions)
- **Documentation**: [Full Setup Guide](https://github.com/ProgrammerNomad/LaraCoreKit/blob/main/DEMO_SETUP.md)

Related Projects
----------------

[](#related-projects)

- [LaraCoreKit](https://github.com/ProgrammerNomad/LaraCoreKit) - Laravel 12 starter kit with modular architecture
- [Demo Website](https://laracorekit.mobrilz.digital/) - Live demo powered by this module

---

**Made with ❤️ for the Laravel community**

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance50

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/183ca17d7d0a46d0cd7473309797fc51c2e3dd8278510dc14ef4c786d4b44be6?d=identicon)[NomadProgrammer](/maintainers/NomadProgrammer)

---

Top Contributors

[![ProgrammerNomad](https://avatars.githubusercontent.com/u/3428506?v=4)](https://github.com/ProgrammerNomad "ProgrammerNomad (8 commits)")

### Embed Badge

![Health badge](/badges/programmernomad-laracorekit-demo-module/health.svg)

```
[![Health](https://phpackages.com/badges/programmernomad-laracorekit-demo-module/health.svg)](https://phpackages.com/packages/programmernomad-laracorekit-demo-module)
```

###  Alternatives

[deployer/deployer

Deployment Tool

11.0k25.4M207](/packages/deployer-deployer)[appwrite/server-ce

End to end backend server for frontend and mobile apps.

55.3k84.2k](/packages/appwrite-server-ce)[pragmarx/health

Laravel Server &amp; App Health Monitor and Notifier

2.0k1.0M2](/packages/pragmarx-health)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[heroku/heroku-buildpack-php

Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP and Apache2/Nginx as on Heroku

8161.3M10](/packages/heroku-heroku-buildpack-php)[tiamo/phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard

4674.7k](/packages/tiamo-phpas2)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
