Download the PHP package cyclechain/sandboxer without Composer

On this page you can find all versions of the php package cyclechain/sandboxer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sandboxer

Sandboxer

Latest Version on Packagist Total Downloads

A zero-modification Laravel package that provides complete data isolation for live product demos, SaaS playgrounds, interactive trial sessions, and testing environments—without altering a single line of your existing models, migrations, or database tables.


🎯 The Problem Sandboxer Solves

When offering live demos or trial sessions for your SaaS or web application, visitors often want to create, edit, or delete data (e.g., creating blog posts, adding products, modifying settings).

Traditionally, developers had to choose between:

  1. Resetting the database periodically: Interrupts active users and causes data collisions across simultaneous visitors.
  2. Modifying application logic & models: Polluting codebase with tenant checks, session filters, or custom traits.
  3. Spinning up isolated containers per user: Expensive, slow, and hard to manage at scale.

🚀 The Sandboxer Solution

Sandboxer intercepts Eloquent CRUD operations per user session transparently. Any data created, updated, or deleted by a demo visitor exists only in their isolated sandbox session.


📦 Installation

Install Sandboxer via Composer.

1. Production & Live Demo Installation

If you are deploying Sandboxer to provide live demo environments, interactive product tours, or sandbox mode in your production or staging SaaS application, install it as a main dependency:

2. Development & Testing Installation

If you are using Sandboxer strictly for local development isolation, testing, or preview environments, install it as a dev dependency:


⚙️ Setup & Migration

Publish the configuration file:

Run the package database migrations (creates sandbox_sessions and sandbox_storage tables):


🚀 Quick Start

Enable sandbox mode in your .env file:

That's it! Sandboxer automatically intercepts database operations whenever sandbox mode is activated.


🔍 Automatic Sandbox Activation

Sandboxer can automatically detect and activate sandbox mode for incoming HTTP requests based on:

  1. Subdomains: demo.yourdomain.com, sandbox.yourdomain.com, try.yourdomain.com
  2. URL Paths: /demo, /sandbox, /try
  3. Query Parameters: ?sandbox=1, ?demo=true
  4. Active Session Cookie: sandbox_session cookie

Configure auto-detection in config/sandboxer.php:


📖 Usage

Sandbox Authentication Integration

For applications requiring demo user login, update your login controller (or custom auth handler) using SandboxAuthHelper:

Manual Sandbox Control

Use the Sandboxer Facade to check or control sandbox state manually:


🧹 Session Expiration & Automatic Cleanup

Sandbox sessions expire automatically based on the SANDBOXER_TTL setting (default: 3600 seconds / 1 hour).

To clean up expired sessions, schedule the SandboxCleanupJob in your app/Console/Kernel.php or routes/console.php:

Or dispatch manually:


🏗️ How It Works (Architecture)

  1. Write Interception: When a model is created, updated, or deleted, ModelEventInterceptor captures the attributes, places the database connection in pretend mode (preventing actual SQL writes), and persists the mutation into sandbox_storage.
  2. Read Interception: When Eloquent queries execute (all(), where(), find()), SandboxScope overlays sandboxed insertions, updates, and deletions onto the retrieved master data.

⚙️ Configuration Reference

Edit config/sandboxer.php:


🧪 Testing

Run the PHPUnit test suite:

Or via Docker:


📄 License

The MIT License (MIT). Please see License File for more information.


👨‍💻 Credits

Developed and maintained by Fatih Mert Doğancan & CycleChain.


All versions of sandboxer with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/database Version ^9.0|^10.0|^11.0|^12.0
illuminate/http Version ^9.0|^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cyclechain/sandboxer contains the following files

Loading the files please wait ...