Need help with laravel-setup-wizard?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

201 Stars 22 Forks MIT License 21 Commits 1 Opened issues


A Laravel package to help you build a web setup wizard for your application

Services available


Need anything else?

Contributors list

Laravel Setup Wizard

A Laravel package to help you build a web setup wizard for your application


Add the package to your project

composer require marvinlabs/laravel-setup-wizard

Declare the service provider and the alias

Add the following line to your

'providers' => [
    // ...
    // Other Service Providers
    // ...

'aliases' => [ // ... // Other aliases // ... 'SetupWizard' => MarvinLabs\SetupWizard\Facades\SetupWizard::class, ],

Declare the required middleware

Add the following line to your

protected $middlewareGroups = [
    // ...
    // Other Middleware
    // ...

'setup_wizard' => [


protected $routeMiddleware = [ // ... // Other Middleware // ...

'setup_wizard.initializer' => \MarvinLabs\SetupWizard\Middleware\SetupWizardInitializer::class,
'setup_wizard.trigger'     => \MarvinLabs\SetupWizard\Middleware\SetupWizardTrigger::class,


Enable the middleware to launch the wizard if necessary

If you want to launch the setup wizard automatically when required, you need to add the

middleware to the routes you wish to protect. For instance, if you have a route group to show an administration panel, you could do it there:
    'prefix'     => 'admin', 
    'middleware' => 'setup_wizard.trigger'
], function () {
        // ...

This way, the setup wizard will only be triggered when trying to access the administration panel.

The middleware to trigger the setup wizard should be put as the first one of the middleware list

Publish assets

To get the CSS right, you need to at least publish the package assets to your public directory:

php artisan vendor:publish --provider="MarvinLabs\SetupWizard\ServiceProvider" --tag="assets"

Optionally, you can publish more files from the package in order to be able to override them. Use the artisan command like you would for any other package (will publish files from all vendor packages):

php artisan vendor:publish

Or you can publish only some of the package files to override just what you need. The library has tagged them into 4 different categories (assets category has been published before):

php artisan vendor:publish --provider="MarvinLabs\SetupWizard\ServiceProvider" --tag="config"
php artisan vendor:publish --provider="MarvinLabs\SetupWizard\ServiceProvider" --tag="views"
php artisan vendor:publish --provider="MarvinLabs\SetupWizard\ServiceProvider" --tag="translations"

If you had published some files before and want to overwrite them, use the

flag with the artisan commands above.


The configuration of the package is done via the

file. Each configuration option is documented within that file and hence we will not repeat this information here.

Adding your own wizard steps

You can easily add or remove steps to the wizard.

Create a step class

The easiest would be to start from one of our bundled steps. A step usually will inherit from

and must implement a few more methods.


This is the data which will be passed to your view. If you do not specify that method, it will return an empty array. The data you pass in this array will be available in the step view directly as a variable. For example, if you return

[ 'myVar' => 23 ]
, you will be able to access
in your step view.


The method which is called before moving on to the next step. The

parameter contains the data that has been submitted with the step form (if any).

That method should return

if the wizard can proceed to the next step. If not, it should return
and can provide user feedback by using the method
$this->addError('my_key', 'My error message')


The method is called when coming back to this step from the next one. This basically undoes everything that has been done by the


That method should return

if the wizard can come back to our step. If not, it should return
and can provide user feedback by using the method
$this->addError('my_key', 'My error message')

Create the step view

If you have registered your step class with the id

, you need to create a view which will be found in the file

Create the strings

Some strings are required for the step to be properly displayed: icon, title, description, etc. These can be found in the file

. You will notice that each step ID contains a few strings which provide this information.

Add your step to configuration


and add your step class to the list of steps for the wizard:
    'steps' => [
        'requirements' => \MarvinLabs\SetupWizard\Steps\RequirementsStep::class,
        'folders'      => \MarvinLabs\SetupWizard\Steps\FoldersStep::class,
        'env'          => \MarvinLabs\SetupWizard\Steps\EnvFileStep::class,
        'database'     => \MarvinLabs\SetupWizard\Steps\DatabaseStep::class,

    'my_step'      => \App\Setup\MyStep::class',

    'final'        => \MarvinLabs\SetupWizard\Steps\FinalStep::class,

The steps are declared in the order in which they will be run. You can of course remove some of the default steps. However, you should always finish the wizard with the FinalStep. That step will write a file which will prevent the setup wizard to be executed again once done. This provides security as nobody will be able to run the setup again if the

file is there.


We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.