Skip to content

Commit

Permalink
Declare Laravel v11 Support
Browse files Browse the repository at this point in the history
  • Loading branch information
bayareawebpro committed Jun 6, 2024
1 parent 2ba021c commit 291d341
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 24 deletions.
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
}
],
"require": {
"php": "^8.0",
"illuminate/http": "^10.0",
"illuminate/support": "^10.0",
"illuminate/session": "^10.0",
"illuminate/contracts": "^10.0",
"illuminate/validation": "^10.0"
"php": "^8.2",
"illuminate/http": "^11.0",
"illuminate/support": "^11.0",
"illuminate/session": "^11.0",
"illuminate/contracts": "^11.0",
"illuminate/validation": "^11.0"
},
"require-dev": {
"phpunit/phpunit": "^10.0",
"orchestra/testbench": "^8.0",
"larastan/larastan": "^v2.6.1"
"phpunit/phpunit": "^11.0",
"orchestra/testbench": "^9.0",
"larastan/larastan": "^2.0"
},
"autoload": {
"psr-4": {
Expand All @@ -32,7 +32,7 @@
}
},
"scripts": {
"test": "vendor/bin/phpunit",
"test": "XDEBUG_MODE=coverage vendor/bin/phpunit",
"lint": "vendor/bin/phpstan analyse"
}
}
23 changes: 9 additions & 14 deletions src/MultiStepForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@
namespace BayAreaWebPro\MultiStepForms;

use Closure;

use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Responsable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;

use Illuminate\Http\Response;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Route;
use Illuminate\Validation\Rule;

use Illuminate\Session\Store as Session;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View;
use Illuminate\Session\Store as Session;

use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Responsable;
use Illuminate\Validation\Rule;

class MultiStepForm implements Responsable, Arrayable
{
Expand Down Expand Up @@ -162,7 +157,7 @@ protected function getData(array $data = []): array
{
return [...$data, ...Collection::make($this->data)
->merge($this->stepConfig()->get('data', []))
->map(fn($value)=>is_callable($value) ? call_user_func($value, $this) : $value)];
->map(fn($value) => is_callable($value) ? call_user_func($value, $this) : $value)];
}

protected function isShowRequest(): bool
Expand Down Expand Up @@ -209,11 +204,11 @@ protected function isNavigationRequest(): bool

protected function handleNavigation(): RedirectResponse|JsonResponse
{
if($this->isPreviousStepRequest()){
if ($this->isPreviousStepRequest()) {
$this->setValue('form_step', $this->requestedStep());
}

if($this->usesViews() && !$this->needsJsonResponse()){
if ($this->usesViews() && !$this->needsJsonResponse()) {
return Redirect::back();
}

Expand Down

0 comments on commit 291d341

Please sign in to comment.