PHPackages                             humans/laravel-sandbox - 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. humans/laravel-sandbox

ActiveLibrary

humans/laravel-sandbox
======================

0.5.0(5y ago)1732MITPHP

Since Sep 5Pushed 5y ago2 watchersCompare

[ Source](https://github.com/humans/laravel-sandbox)[ Packagist](https://packagist.org/packages/humans/laravel-sandbox)[ RSS](/packages/humans-laravel-sandbox/feed)WikiDiscussions trunk Synced 1mo ago

READMEChangelogDependencies (2)Versions (15)Used By (0)

Laravel Sandbox
===============

[](#laravel-sandbox)

Laravel Sandbox is a package to easily add front-end support to database factories.

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

[](#installation)

```
composer require humans/laravel-sandbox
```

Create your first Sandbox
-------------------------

[](#create-your-first-sandbox)

Sandbox provides an artisan command to create a sandbox class. All files are added to your `app/Sandbox` folder.

```
php artisan sandbox:make SalesDemo
```

Register your Sandbox in a Service Provider
-------------------------------------------

[](#register-your-sandbox-in-a-service-provider)

The Sandboxes needs to be registered to something something.

```
Sandbox::register([
    \App\Sandbox\SalesDemo::class,
]);
```

Add functionality to your Sandbox
---------------------------------

[](#add-functionality-to-your-sandbox)

```
use Auth;
use Humans\Sandbox\Contracts\RefreshDatabase;
use Humans\Sandbox\Sandbox;

class SalesDemo extends Sandbox implements RefreshDatabase
{
    public function run()
    {
        Auth::login(
             factory(\App\User::class)->create()
        );

        return redirect()->route('home');
    }
}
```

Create a view for your sandboxes.
---------------------------------

[](#create-a-view-for-your-sandboxes)

```
@foreach (Sandbox::sandboxes() as $sandbox)
  {{ $sandbox->title() }}

    @csrf
