PHPackages                             ycs77/laravel-wizard - 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. ycs77/laravel-wizard

ActiveLibrary

ycs77/laravel-wizard
====================

A web setup wizard for Laravel application.

v4.5.0(1y ago)12022.2k—8.8%18MITPHPPHP &gt;=8.2

Since Jun 11Pushed 1y ago5 watchersCompare

[ Source](https://github.com/ycs77/laravel-wizard)[ Packagist](https://packagist.org/packages/ycs77/laravel-wizard)[ Docs](https://github.com/ycs77/laravel-wizard)[ Patreon](https://www.patreon.com/ycs77)[ RSS](/packages/ycs77-laravel-wizard/feed)WikiDiscussions 4.x Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (53)Used By (0)

Laravel Wizard
==============

[](#laravel-wizard)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ab3bbd03c5249a70c32dcbbb14cf953c4ded666dd0b5432ef066593fff341220/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79637337372f6c61726176656c2d77697a6172643f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ycs77/laravel-wizard)[![Software License](https://camo.githubusercontent.com/c090e080484e2a2bc766446291d04437db823929042bf614b26a1643660ddf6f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e3f7374796c653d666c61742d737175617265)](LICENSE)[![GitHub Tests Action Status](https://camo.githubusercontent.com/b7bee79f3cfeb6deae96e982bfbe1176c256529e7adb6e224ab1a75839c5b2de/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f79637337372f6c61726176656c2d77697a6172642f74657374732e796d6c3f6272616e63683d342e78266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/ycs77/laravel-wizard/actions/workflows/tests.yml?query=branch%3A4.x)[![Style CI Build Status](https://camo.githubusercontent.com/1b8568b468be0a3f873118bacff1e2a2af87f64a387d6faf74bb701d3c0423cc/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3139303837363732362f736869656c643f7374796c653d666c61742d737175617265)](https://github.styleci.io/repos/190876726)[![Total Downloads](https://camo.githubusercontent.com/505daecf6ab35e9d385cbc77c2c7f5e58314d225962e3b9bfbf88ceea3953fc8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f79637337372f6c61726176656c2d77697a6172643f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ycs77/laravel-wizard)

A web setup wizard for Laravel application.

> This package is adapted from [smajti1/laravel-wizard](https://github.com/smajti1/laravel-wizard).

[![Laravel wizard main image.](docs/laravel-wizard-main-image.jpg)](docs/laravel-wizard-main-image.jpg)

Table of Contents
-----------------

[](#table-of-contents)

- [Laravel Wizard](#laravel-wizard)
    - [Table of Contents](#table-of-contents)
    - [Version Compatibility](#version-compatibility)
    - [Installation](#installation)
    - [Usage](#usage)
        - [1. Generate controller and wizard steps](#1-generate-controller-and-wizard-steps)
        - [2. Set steps](#2-set-steps)
        - [3. Install wizard steps CSS package](#3-install-wizard-steps-css-package)
    - [Cache](#cache)
        - [Database Driver](#database-driver)
        - [Disable Cache](#disable-cache)
    - [Controller](#controller)
        - [Setting Configuration](#setting-configuration)
    - [Customize View](#customize-view)
    - [Step](#step)
        - [Get cached data](#get-cached-data)
        - [Redirect to the step](#redirect-to-the-step)
        - [Step repository](#step-repository)
        - [Upload Files](#upload-files)
        - [Skip step](#skip-step)
        - [Passing data to views](#passing-data-to-views)
        - [Save data on another step](#save-data-on-another-step)
        - [Set relationships model](#set-relationships-model)
        - [Force restart from first step](#force-restart-from-first-step)
    - [Commands](#commands)
    - [Sponsor](#sponsor)
    - [Credits](#credits)
    - [License](#license)

Version Compatibility
---------------------

[](#version-compatibility)

Laravel WizardLaravelPHP1.0.x5.5^7.01.1.x^5.6^7.1.32.0.x,2.1.x^5.6 | ^6.x^7.1.32.2.x^5.6 | ^6.x | ^7.x^7.1.32.3.x&gt;=5.6 | &lt;=9.0&gt;=7.1.3 | &lt;=8.23.x&gt;=9.0&gt;=8.14.x&gt;=11.0&gt;=8.2Installation
------------

[](#installation)

Install the package via composer:

```
composer require ycs77/laravel-wizard
```

Publish config:

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

Usage
-----

[](#usage)

### 1. Generate controller and wizard steps

[](#1-generate-controller-and-wizard-steps)

Now you can qckly generate the wizard controller and the wizard steps:

```
php artisan make:wizard User NameStep,EmailStep
```

This command generates the `UserWizardController`, `NameStep`, and `EmailStep` class, and appends the wizard route to `routes/web.php`.

*routes/web.php*

```
use App\Http\Controllers\UserWizardController;
use Illuminate\Support\Facades\Route;
use Ycs77\LaravelWizard\Facades\Wizard;

...

Wizard::routes('/wizard/user', UserWizardController::class, 'wizard.user');
```

> If you can't use auto append route, you can set `config/wizard.php` attribute `append_route` to `false`.

### 2. Set steps

[](#2-set-steps)

This is generated NameStep class, you can to `model` method set the model, to `rules` method set form validation, and save `$data` to your database via the `saveData` method, for example:

*app/Steps/User/NameStep.php*

```
