-
Notifications
You must be signed in to change notification settings - Fork 0
Starter kit alignment - 2026-05-20 #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
techenby
merged 12 commits into
main
from
starter-kit-upgrade-20260520-1057-all-upstream
May 24, 2026
Merged
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6269c65
starter-kit-upgrade: auth team redirects
techenby a0af47f
starter-kit-upgrade: passkeys and security settings
techenby d2ed1a2
starter-kit-upgrade: align teams implementation
techenby 2d68959
starter-kit-upgrade: frontend and migration maintenance
techenby e09ea1c
starter-kit-upgrade: dependency lockfiles
techenby 5da86b1
Rector 🏗️ & Dusting 🧹
techenby f8b26fd
Remove comments
techenby a37fd9f
Move migration changes
techenby cbad29f
Swap test style
techenby 93c5cfe
Run `php artisan install:features`
techenby beea186
Remove chisel comments
techenby bbaf002
Merge branch 'main' into starter-kit-upgrade-20260520-1057-all-upstream
techenby File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace App\Console\Commands; | ||
|
|
||
| use Illuminate\Console\Command; | ||
| use Laravel\Chisel\Chisel; | ||
| use Laravel\Chisel\Question; | ||
| use Laravel\Chisel\Script; | ||
| use RuntimeException; | ||
|
|
||
| use function Laravel\Prompts\multiselect; | ||
| use function Laravel\Prompts\spin; | ||
|
|
||
| class InstallFeaturesCommand extends Command | ||
| { | ||
| protected $signature = 'install:features | ||
| {--answers= : JSON string of answers to skip interactive prompts}'; | ||
|
|
||
| protected $description = 'Choose which starter kit features to keep'; | ||
|
|
||
| public function handle(): int | ||
| { | ||
| if (getenv('LARAVEL_INSTALLER_DEFER_HOOKS') && $this->option('answers') === null) { | ||
| return self::SUCCESS; | ||
| } | ||
|
|
||
| if (! file_exists(base_path('chisel.php'))) { | ||
| return self::SUCCESS; | ||
| } | ||
|
|
||
| /** @var Script $script */ | ||
| $script = require base_path('chisel.php'); | ||
|
|
||
| $providedAnswers = $this->option('answers') === null | ||
| ? [] | ||
| : json_decode((string) $this->option('answers'), true, 512, JSON_THROW_ON_ERROR); | ||
|
|
||
| $answers = $script | ||
| ->collectAnswers() | ||
| ->onQuestion(fn (Question $question) => match ($question->type) { | ||
| 'multiselect' => multiselect( | ||
| label: $question->label, | ||
| options: $question->options, | ||
| default: $question->default ?? [], | ||
| required: $question->required, | ||
| hint: $question->hint, | ||
| ), | ||
| default => throw new RuntimeException("Unsupported question type [{$question->type}]."), | ||
| }) | ||
| ->interactive($this->input->isInteractive()) | ||
| ->withAnswers($providedAnswers); | ||
|
|
||
| $this->installNodeDependencies(); | ||
|
|
||
| $script->chisel($answers); | ||
|
|
||
| $this->buildAssets(); | ||
|
|
||
| return self::SUCCESS; | ||
| } | ||
|
|
||
| protected function installNodeDependencies(): void | ||
| { | ||
| $npm = Chisel::in(base_path())->npm(); | ||
| $packageManager = $npm->packageManager(); | ||
|
|
||
| spin( | ||
| fn () => $npm->install(), | ||
| "Installing dependencies with {$packageManager->value}...", | ||
| ); | ||
| } | ||
|
|
||
| protected function buildAssets(): void | ||
| { | ||
| $npm = Chisel::in(base_path())->npm(); | ||
|
|
||
| spin( | ||
| fn () => $npm->run('build'), | ||
| 'Building assets...', | ||
| ); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace App\Http\Responses\Concerns; | ||
|
|
||
| use App\Models\Team; | ||
| use Illuminate\Http\Request; | ||
| use Illuminate\Support\Facades\URL; | ||
|
|
||
| trait RedirectsToCurrentTeam | ||
| { | ||
| protected function redirectPathForCurrentTeam(Request $request, string $redirect): string | ||
| { | ||
| $team = $this->currentTeam($request); | ||
|
|
||
| URL::defaults(['current_team' => $team->slug]); | ||
|
|
||
| return "/{$team->slug}{$redirect}"; | ||
| } | ||
|
|
||
| protected function currentTeam(Request $request): Team | ||
| { | ||
| $user = $request->user(); | ||
| $team = $user?->currentTeam ?? $user?->personalTeam(); | ||
|
|
||
| abort_unless($team, 403); | ||
|
|
||
| return $team; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace App\Http\Responses; | ||
|
|
||
| use App\Http\Responses\Concerns\RedirectsToCurrentTeam; | ||
| use Illuminate\Http\JsonResponse; | ||
| use Laravel\Fortify\Fortify; | ||
| use Laravel\Passkeys\Contracts\PasskeyLoginResponse as PasskeyLoginResponseContract; | ||
| use Symfony\Component\HttpFoundation\Response; | ||
|
|
||
| class PasskeyLoginResponse implements PasskeyLoginResponseContract | ||
| { | ||
| use RedirectsToCurrentTeam; | ||
|
|
||
| public function toResponse($request): Response | ||
| { | ||
| $redirect = $this->redirectPathForCurrentTeam($request, Fortify::redirects('login')); | ||
|
|
||
| return $request->wantsJson() | ||
| ? new JsonResponse(['redirect' => redirect()->intended($redirect)->getTargetUrl()], 200) | ||
| : redirect()->intended($redirect); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <?php | ||
|
|
||
| return [ | ||
| 'welcome' => 'resources/views/welcome.blade.php', | ||
| 'login' => 'resources/views/pages/auth/login.blade.php', | ||
| 'register' => 'resources/views/pages/auth/register.blade.php', | ||
| 'confirm_password' => 'resources/views/pages/auth/confirm-password.blade.php', | ||
| 'verify_email' => 'resources/views/pages/auth/verify-email.blade.php', | ||
| 'two_factor_challenge' => 'resources/views/pages/auth/two-factor-challenge.blade.php', | ||
|
|
||
| 'profile_files' => [ | ||
| 'resources/views/pages/settings/profile.blade.php', | ||
| ], | ||
|
|
||
| 'security_files' => [ | ||
| 'resources/views/pages/settings/security.blade.php', | ||
| ], | ||
|
|
||
| 'two_factor_files' => [ | ||
| 'resources/views/pages/settings/two-factor-setup-modal.blade.php', | ||
| 'resources/views/pages/settings/two-factor/recovery-codes.blade.php', | ||
| ], | ||
| ]; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.