Download the PHP package rinodrummer/livewire-wizard-form without Composer

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

Livewire Wizard Form — A step form wizard package for Livewire

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

[!WARNING] This package is currently under active development. Its use is at the developer's discretion and may include breaking changes or experimental features. Proceed with caution and always test thoroughly before using in production.

This package is heavily inspired from spatie/laravel-livewire-wizard, and it lets create wizard forms with steps easily.

It provides a set of plug-and-play traits/interfaces that let you introduce mechanics directly into your own Livewire components.

The concept behind this package is that every aspect of its sourcecode can be adapted to your needs, by letting you override every bit you need.

Requirements

The package is compatible with:

Installation

You can install the package via Composer:

Usage

To create a new wizard component, you need to implement the WizardComponent interface and use the IsWizard trait in a Livewire component you created normally.

This trait requires a method to be implemented, which is steps():

Usually, this method should return an array of strings, but enums can be used too!

When referencing to an enum (which should be a \BackedEnum), we need to pair the steps() method with the useEnum() one, this method usually returns null, but in this case we can override it by returning the class-string of the preferred enum which cases are going to represent the steps:

Now, the package basically matched for every component named like <step name>-step, but in some scenarios (especially if paired with enums) maybe needed to customize the logic behind the step components naming/matching, in this case you can override the currentStepComponent() method, like in the following example:

Now it's possible to proceed with the wizard Blade part!

To render the current step, there is a custom Blade component that has to be included in the Blade file of your component.

This is just wrapper for livewire:dynamic-component which passes the right set of properties to the current step component:

Consider that this component will not add any wrapping element but directly include your step components, but you can make this component look as you need!

We've set up our wizard component, now we can create a step component; make a new Livewire component as usual and then add this package's magic:

A step must have a state property which will collect its data, and the eligible property can be marked in different ways:

  1. By using the StepStateProperty attribute on a property;
  2. By defining a method named stepProperty();
  3. By defining a property named $stateProperty.

You can adopt your favourite solution!

You can even choose to use Forms:

Doing that, we can achieve a cleaner code while having all the validation logic in a dedicated file, but right now, no validation will be executed when proceeding to the next step.

To enable validation before proceeding, we can use one of the following solutions:

  1. By using the ValidatedStep attribute on the component class;
  2. By implementing the ValidatesStep interface;

Doing this, the package will validate the step and store the validated data in the wizard state.

Navigating through the steps

The package relies on Livewire Events to move from a step to another, the dispatched events are the following:

The step component offers two methods to easily perform all the navigation logic:

Every time they are called, they store the step state in the wizard state to let the user continue where they left, but this mechanic can be skipped by setting the $quitely argument to true.

Submitting the wizard

To submit the wizard, we can rely on another event, submit-wizard.

This can be dispatched by calling one of the following methods:

FAQs

Can I add properties or methods to my components?

Absolutely! That's the meaning of this whole package!

Fill free to make your components the way you prefer, even overriding every method provided by this project's traits!

Is there a way to easily manage a step icon or a label?

Yes! You can use the Teleport feature from Livewire (or the directive from Alpine.js)!

You could do like this:

This is just an example, but you can do any magic you prefer to keep your UI aligned with the current step!

Testing

Right now the package has majorly been tested by being used in a project, but every contribution, especially in matter of tests, is extremely welcomed!

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

This package is heavily inspired by spatie/laravel-livewire-wizard, and has been developed using spatie/package-skeleton-laravel.

Thanks Spatie to their incredible contribution to the PHP and Laravel ecosystems!

A huge thanks goes to Taylor Otwell for Laravel and Caleb Porzio for Livewire.

License

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


All versions of livewire-wizard-form with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/contracts Version ^10.0||^11.0||^12.0
livewire/livewire Version ^3.5
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 rinodrummer/livewire-wizard-form contains the following files

Loading the files please wait ....