Download the PHP package sjwatts119/livewire-wizard without Composer

On this page you can find all versions of the php package sjwatts119/livewire-wizard. 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 livewire-wizard

A Simple Headless Livewire Wizard Component.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

View Package Demo

Installation

Install the package via composer:

Creating Your First Wizard

To make your first wizard component, run the following command:

This command supports any arguments used in the Livewire Make Command.

A new wizard class and a corresponding step view will have been created. The class will look like this:

Creating Wizard Steps

To create a new Wizard Step, you can add a new WizardStep instance in the wizardSteps() array.

A WizardStep accepts:

Here is an example of a contact form wizard with two steps:

Defining Step Rules

As mentioned previously, a WizardStep can accept a canNavigate closure. This closure will be called when the step is rendered, and should return a boolean value.

The wizard class exposes a helpful method validatePropertiesForStep() which can be used to validate any number of class properties. Internally, this uses Livewire's Validation to validate the properties, and returns a boolean value indicating whether the validation passed for all provided properties.

This validation also works with Livewire Form Object Properties. These should be referenced using dot notation, e.g. form.name.

For example, the following step will only be accessible if the validation rules defined on the name and message properties pass:

Rendering The Wizard

If you'd like to retrieve the view for the current step, you can call:

If any of your steps have canNavigate closures, you can run these before rendering the view:

The authorise() method will abort with a 403 response if the closure returns false.

Optionally, you can pass a false boolean value to the aborts parameter of authorise().

This will cause a StepNotAuthorisedException to be thrown when the canNavigate closure returns false instead of aborting the request. You could then gracefully handle this exception using Livewire's Exception Lifecycle Hook. For example:

Navigation

In your step views, you likely want to add some navigation buttons to allow the user to move between steps.

You could use the wire:click directive to call any of the navigation methods on the wizard class. For example:

Wizard Methods

The wizard component has a number of public methods which can be used to get information about the current state of the wizard. These methods are:

Wizard Navigation Methods

You can use the following methods to navigate between steps in the wizard:

WizardStep Methods

The WizardStep class has a number of methods which can be used to render the step in your view. These methods are:

Running Tests

To run the tests, install dependencies:

Then run the tests using:

Credits

License

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


All versions of livewire-wizard with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^11.0||^12.0
livewire/livewire Version ^3.0
spatie/laravel-package-tools Version ^1.16
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 sjwatts119/livewire-wizard contains the following files

Loading the files please wait ....