PHPackages                             dgvai/laravel-demo-mode - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. dgvai/laravel-demo-mode

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dgvai/laravel-demo-mode
=======================

Your Project Protector in Online Markets

1.0.0(5y ago)217MITPHP

Since May 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/dgvai/laravel-demo-mode)[ Packagist](https://packagist.org/packages/dgvai/laravel-demo-mode)[ RSS](/packages/dgvai-laravel-demo-mode/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Demo Mode - A Protector For Your Project in Online Market
=========================================================

[](#demo-mode---a-protector-for-your-project-in-online-market)

[![Latest Stable Version](https://camo.githubusercontent.com/b796f61de246d2e29f039fa8ac51b68222d3fa6d3b690a0cbe3730c9969e1643/68747470733a2f2f706f7365722e707567782e6f72672f64677661692f6c61726176656c2d64656d6f2d6d6f64652f762f737461626c65)](https://packagist.org/packages/dgvai/laravel-demo-mode)[![Total Downloads](https://camo.githubusercontent.com/0c032b969797b07dd49774dd70611e371a691db75163111c995d9d45c21f067c/68747470733a2f2f706f7365722e707567782e6f72672f64677661692f6c61726176656c2d64656d6f2d6d6f64652f646f776e6c6f616473)](https://packagist.org/packages/dgvai/laravel-demo-mode)[![Latest Unstable Version](https://camo.githubusercontent.com/5a352e8061a2dd0fce927621a32d8741b0a9c48c9f32330520d9eff268649f7c/68747470733a2f2f706f7365722e707567782e6f72672f64677661692f6c61726176656c2d64656d6f2d6d6f64652f762f756e737461626c65)](https://packagist.org/packages/dgvai/laravel-demo-mode)[![License](https://camo.githubusercontent.com/958e30a866bf5204c3ad393ab73dccbac7e918e5c55de61afaf3e583fb591f2b/68747470733a2f2f706f7365722e707567782e6f72672f64677661692f6c61726176656c2d64656d6f2d6d6f64652f6c6963656e7365)](https://packagist.org/packages/dgvai/laravel-demo-mode)[![Monthly Downloads](https://camo.githubusercontent.com/aabfea0d5f7cee3833e1a39e5a8239ca3aa6c0de0ce86e628bbbe617cd639c5d/68747470733a2f2f706f7365722e707567782e6f72672f64677661692f6c61726176656c2d64656d6f2d6d6f64652f642f6d6f6e74686c79)](https://packagist.org/packages/dgvai/laravel-demo-mode)[![Daily Downloads](https://camo.githubusercontent.com/2e7519233d6bee3f88709b850cdb55e6069aaeb0f5ccdcf389f8e03c3c0f934a/68747470733a2f2f706f7365722e707567782e6f72672f64677661692f6c61726176656c2d64656d6f2d6d6f64652f642f6461696c79)](https://packagist.org/packages/dgvai/laravel-demo-mode)[![composer.lock](https://camo.githubusercontent.com/6be92d8c17822f0490290fac14535f4007aaa7b8839ab28f9161afa6f0e03648/68747470733a2f2f706f7365722e707567782e6f72672f64677661692f6c61726176656c2d64656d6f2d6d6f64652f636f6d706f7365726c6f636b)](https://packagist.org/packages/dgvai/laravel-demo-mode)

This package protects your projects in online market. Sometimes, in markets, the trial users uploads/saves/changes arbitrary informations that destroys the beauty of your project for the next visitors. This package comes to play in those cases.

Contents
--------

[](#contents)

- [Demo Mode - A Protector For Your Project in Online Market](#demo-mode---a-protector-for-your-project-in-online-market)
    - [Contents](#contents)
    - [Installation](#installation)
        - [Publish Configuration](#publish-configuration)
        - [Setup and configure](#setup-and-configure)
            - [After Done Configuration](#after-done-configuration)
    - [Usage](#usage)
    - [Changelog](#changelog)
    - [License](#license)

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

[](#installation)

You can install the package via composer:

```
    composer require dgvai/laravel-demo-mode
```

### Publish Configuration

[](#publish-configuration)

Publish configuration file

```
    php artisan vendor:publish --tag=demomode
```

**For users bellow laravel &lt; 5.5**Add service provider to config/app.php

```
    "DGvai\DemoMode\DemoModeServiceProvider"
```

### Setup and configure

[](#setup-and-configure)

```
    /**
         * ENABLE DEMO MODE?
         * ------------------------
         * Use from true to enable demo
         * mode for your production env
         *
         */

        'enabled' => env('DEMO_ENABLED',true),

        /**
         * CUSTOM FLASH VARIABLE
         * ------------------------
         * If you want to use custom flash
         * alerts like, realrashid/sweetalert2
         * has toast_error, success, etc flash
         * variables to show alert, then use it
         * here.
         *
         */

        'flash' => 'demo_info',

        /**
         * CUSTOM MESSAGE
         * ------------------------
         * If you want to show a custom flash
         * message to the users, set it here.
         *
         */

        'msg' => 'Further action is disabled in demo mode!'
```

#### After Done Configuration

[](#after-done-configuration)

```
    php artisan config:cache
```

Usage
-----

[](#usage)

Simply use a **middleware** `demo` to the **routes** you want to protect. Such has *save* routes.

```
    Route::post('/save',function(){
        ....
        return 'Furthur Actions';
        ...
    })->middleware('demo')->name('save');
```

To show the flash message, like an alert, into your view:

```
    @if(session()->has('demo_info'))

        {{session()->get('demo_info')}}

    @endif
```

Or if you have used any custom flash, like `realrashid/sweetalert2` has `toast_success` flash, it will automatically show the toast.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

License
-------

[](#license)

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

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2180d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/53512998?v=4)[Jalal Uddin](/maintainers/dgvai)[@dgvai](https://github.com/dgvai)

---

Top Contributors

[![dgvai](https://avatars.githubusercontent.com/u/53512998?v=4)](https://github.com/dgvai "dgvai (1 commits)")

---

Tags

composer-packagedemo-modelaravellaravel-demolaravel-package

### Embed Badge

![Health badge](/badges/dgvai-laravel-demo-mode/health.svg)

```
[![Health](https://phpackages.com/badges/dgvai-laravel-demo-mode/health.svg)](https://phpackages.com/packages/dgvai-laravel-demo-mode)
```

###  Alternatives

[mnshankar/linear-regression

PHP package for computation of simple linear regression parameters

2323.3k](/packages/mnshankar-linear-regression)

PHPackages © 2026

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