Installation
Arcanist requires PHP 8 and Laravel 8.
composer require laravel-arcanist/arcanist
Documentation
You can find the full documentation here.
Credits
License
MIT
Arcanist requires PHP 8 and Laravel 8.
composer require laravel-arcanist/arcanist
You can find the full documentation here.
MIT
Currently there are renderers available for blade templates and Inertia.js (I am not familiar with this, so bare with me). If I have a JavaScript frontend project (Vue, React, Svelte, etc.) that is separate from the Laravel side, how best would I pass the data back and forth? I suppose I could start with WizardStep::viewData, I would just need to dig into the source code and docs a bit more to figure that out. Are there any caveats I should know about?
Issue reference: #43
Please let me know if there's anything I can change here, I've tried to implement this in the most elegant way without having to modify a bunch of logic. I needed this for a personal project, and it works fine as is (afaik), but if there's a better way of doing this without rewriting the entire wizard logic let me know 😂
Hi there, I see this package very useful for something my company is trying to do
Also we're using InertiaJS, it will be very nice to have compatibility with this package like the "Custom renderers" (which seems wip in the docs page) and sharing data will be much easier reusing Inertia's methods.
The following PR will allow the onCompleteAction
class to have information about the wizard in addition to the already available payload.
E.g.
<?php
namespace App\Wizards\Registration;
use Arcanist\Action\WizardAction;
use Arcanist\Action\ActionResult;
class RegistrationAction extends WizardAction
{
public function execute($payload, $wizard): ActionResult
{
return $this->success();
}
}
Hi there,
Firstly, I'm having an amazing time playing with this package, thank you for the time & effort you've put in to it!
I noticed that I was getting a 500 error when trying to access data in the payload of my Action class but only on the first time I tried to submit, if I refreshed it worked fine.
I traced this through in the code (AbstractWizard.php
) and found that the instance doesn't have access to the updated data yet in processLastStep
- I'm assuming it's been persisted but not reloaded/attached to the instance straight away.
I fixed this on the example I'm working with by reloading the wizard after the saveStepData
call in the update function.
EDIT: I'm also using the inertia-response-renderer package incase that infromation is helpful
Disclaimer
It's highly likely I'm using this wrong so if I am, I apologise for wasting your time,
Cheers!
bugThere are some attributes/methods in the AbstractWizard
and WizardStep
classes which we need to access in child-classes.
I've changed their visibility to protected
.
First of all we pushed our Renderer to GitHub today: suenerds/arcanist-rest-api-renderer
We tried to implement a cancel button today and found a hardcoded
redirect response in the Wizard destroy
method.
Idea for a solution: You have build a delete hook for clean up purposes. As we need a way to overwrite the redirect response I want to use the same mechanism for completing the wizard
/**
* The action that gets executed after the last step of the
* wizard is completed.
*/
protected string $onDeleteAction = NullAction::class;
/**
* Gets called after the last step in the wizard is finished.
*/
protected function onAfterDelete(ActionResult $result): Response | Responsable | Renderable
{
return new JsonResponse([
'redirect' => [
'path' => '/wizard/assignments'
]
]);
}
public function destroy(Request $request, string $wizardId): Response | Responsable | Renderable
{
$this->load($wizardId);
$result = $this->actionResolver
->resolveAction($this->onDeleteAction)
->execute($this->transformWizardData());
if (!$result->successful()) {
return $this->responseRenderer->redirectWithError(
$this->currentStep(),
$this,
$result->error()
);
}
$this->wizardRepository->deleteWizard($this);
return $this->onAfterDelete($result);
}
The Delete Hook will be an Action Class
after that and we can use the onAfterDelete
function to do whatever we need to do after Delete.
I will update this issue when my PR is ready.
Publishing then running the migrations fails with the following error:
SQLSTATE[42000]: Syntax error or access violation: 1101 BLOB, TEXT, GEOMETRY or JSON column 'data' can't have a default value (SQL: create table `wizards` (`id` int unsigned not null auto_increment primary key, `class` varchar(255) not null, `data` json not null default '[]', `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')
bug
This PR adds support for using Wizards in Statamic.
https://statamic.dev/controllers#antlers-views
Statamic\View\View
as a response type where applicable.StatamicResponseRenderer
and added new config.To use this, you need to put the following in the register
method of your AppServiceProvider:
$this->app->bind(StatamicResponseRenderer::class, function () {
return new StatamicResponseRenderer(
config('arcanist.renderers.statamic.view_base_path', 'wizards')
);
});
I couldn't figure out a way to put this Response Renderer in its own package because it required a new return type. If there is a better way to organize this, please let me know so I can make changes.
Add two methods in WizardSteps:
The method results are both used as common arguments validation
It's common to still need access to things like $request->user()->id in the execute() method of an action.
There is a request() helper but I thought this make things nicer
I'm also wondering if $payload here can be typehinted as array since you already declared $data as an array in AbstractWizard
Good Morning,
First off, love the package 👍🏻
We noticed that we are encountering an issue with the UnknownStepException being triggered if a user decided to change the step slug within the URL. This is of course intentional but is there a way in which we can capture the error and return a NotFoundHttpException instead or redirect the user back to the first step?
Thanks, Matthew
I don't know how they do but sometimes my users end the workflow but the action seems to be not called.
I get an issue Arcanist\AbstractWizard::firstIncompleteStep(): Return value must be of type Arcanist\WizardStep, null returned
I suppose availableSteps()
returns an empty collection and the first
method returns null.
So I use the last step as default value.
Hi,
I'm experiencing with this package and I have a trouble with file uploading:
WizardAction
I'm reading a file field (e.g. avatar) through $payload
and i want to do something like Storage::putFile('avatars', $payload['avatar']);
to store file in a local storage, but $payload['avatar']
is always an empty array. How to fix that?Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires laravel-arcanist/inertia-response-renderer ^0.5.0 -> satisfiable by laravel-arcanist/inertia-response-renderer[0.5.0].
- laravel-arcanist/inertia-response-renderer 0.5.0 requires inertiajs/inertia-laravel ^0.4.1 -> found inertiajs/inertia-laravel[v0.4.1, ..., v0.4.5] but it conflicts with your root composer.json require (^0.5.1).
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions
This PR lets you define validation rules for nested array input:
Field::make('checkboxes')
->rules(['checkboxes.*' => 'in:optionA,optionB')
Full Changelog: https://github.com/laravel-arcanist/arcanist/compare/0.7.0...0.8.0
Source code(tar.gz)Full Changelog: https://github.com/laravel-arcanist/arcanist/compare/0.6.0...0.7.0
Source code(tar.gz)Full Changelog: https://github.com/laravel-arcanist/arcanist/compare/0.5.2...0.6.0
Source code(tar.gz)fields
method to public
. This should make it possible to have generic
templates by looping over the field definitions (#17, @thoresuenert)ResponseRenderer
interface to be less restrictivestatic
inside of Field::make()
to make it easier to extend from the Field
class (#15).
This is a potentially breaking change if you've extended from the Field class in your codemake:wizard
and make:wizard-step
commandstransform
method to Field
class to register arbitrary callbacks for a field.
Note that whatever the callback returns is the value that gets persisted for the field.WizardRepository
implementations no longer throw an exception when trying to delete
a wizard that doesn’t exist. (#1)Initial release
Source code(tar.gz)Laravel 2-Step verification is a package to add 2-Step user authentication to any Laravel project easily. It is configurable and customizable. It uses notifications to send the user an email with a 4-digit verification code. Laravel 2-Step Authentication Verification for Laravel. Can be used in out the box with Laravel's authentication scaffolding or integrated into other projects.
TALL-stack form generator Laravel Livewire, Tailwind forms with auto-generated views. Support Contributions Features This is not an admin panel genera
Livewire component that provides you with a wizard that supports multiple steps form while maintaining state.
Laravel HTML 5 Inputs Composer package which adds support for HTML5 elements by extending Laravel's Form interface (e.g. Form::date()) Adds support fo
The unobtrusive Laravel package that makes your app multi tenant. Serving multiple websites, each with one or more hostnames from the same codebase. B
php-pkg-template Run multi tasks by PHP multi process Install composer composer require phppkg/taskpm Usage github: use the template for quick create
css-colors Takes in a HEX color and produces variations of that colour for the foreground and background It takes a great php class made by Patrick Fi
Introduction This package gives you a set of conventions to make the most out of Hotwire in Laravel (inspired by the turbo-rails gem). There is a comp
Repository Repository Pattern in Laravel. The package allows to filter by request out-of-the-box, as well as to integrate customized criteria and any
Artisan UI A nice GUI for Laravel Artisan, ready out of the box, configurable and handy for non-CLI experienced developers. Supported commands must be
?? Laravel Deployer Looking for the old Laravel Deployer? Click here. Laravel Deployer is no longer the package it used to be. Since that package was
DMS Filter Component This library provides a service that can be used to filter object values based on annotations Install Use composer to add DMS\Fil
Laravel Multi Domain An extension for using Laravel in a multi domain setting Description This package allows a single Laravel installation to work wi
Laravel Boilerplate Project Laravel Boilerplate provides a very flexible and extensible way of building your custom Laravel applications. Table of Con
A Laravel Fractal package for building API responses, giving you the power of Fractal with Laravel's elegancy.
Laravel 5 form builder Form builder for Laravel 5 inspired by Symfony's form builder. With help of Laravels FormBuilder class creates forms that can b
Integrating razorpay payment gateway in laravel with submit form and storing payment details in payment table. How to settup the project in your local
Laravel Livewire Forms Laravel Livewire form component with declarative Bootstrap 5 fields and buttons. Requirements Bootstrap 5 Installation composer
Dynamic Form Builder for Laravel with Vue.js Create even the most complex forms with ease, using two-sided validation, eloquent, nested elements, cond