Skip to content

Upgrade to Laravel 13 + nativephp/desktop, install laravel/boost#5

Draft
simonhamp wants to merge 1 commit into
mainfrom
boost-laravel13
Draft

Upgrade to Laravel 13 + nativephp/desktop, install laravel/boost#5
simonhamp wants to merge 1 commit into
mainfrom
boost-laravel13

Conversation

@simonhamp

Copy link
Copy Markdown
Member

Summary

  • Replaces nativephp/electron + nativephp/laravel with the unified nativephp/desktop ^2.0, which is the first NativePHP package to declare illuminate/contracts ^13.0 support.
  • Bumps laravel/framework to ^13.0 and laravel/tinker to ^2.8|^3.0 (tinker 2.x caps at L12).
  • Adds laravel/boost ^2.0 (dev) and the artifacts produced by php artisan boost:installCLAUDE.md, .mcp.json, boost.json, plus the bundled .claude/skills/ (laravel-best-practices, livewire-development, tailwindcss-development).
  • Renames Native\Laravel\Native\Desktop\ everywhere it's referenced — providers, listeners, middleware registration in app/Http/Kernel.php, every Livewire component, and the facade aliases in config/app.php.
  • Updates the native:dev Composer script to call php artisan native:run (native:serve is now deprecated in nativephp/desktop).

Notifications screen fix

While exercising the upgraded app, the /notifications Livewire component threw MethodNotFoundException: Public method [toJSON] not found on component from POST /livewire/update.

Root cause: the Blade view mutated a Livewire array directly through the $wire proxy with patterns like $wire.actions.push(''), $wire.actions.splice(index, 1) and x-model="$wire.actions[index]". Livewire 3.8's $wire proxy now routes those access paths through JSON.stringify, which invokes $wire.toJSON() — and the proxy faithfully POSTs that as a real server-side method call, exploding in HandleComponents::callMethods.

Fix uses the canonical Livewire 3 pattern:

  • Added addAction() / removeAction(int $index) public methods on App\Livewire\Notifications.
  • Replaced the Alpine x-for block with @foreach + wire:click and wire:model.live="actions.{{ \$index }}".
  • Removed the dangling x-data="actions" (no matching Alpine.data registration existed).

Verified

  • php artisan package:discover, optimize:clear, route:list, about all clean on Laravel 13.8.0.
  • Web preview boots, resolves Native\Desktop\Facades\App, and only fails at the expected localhost:4000 Electron sidecar call (which isn't running in the preview).

Test plan

  • composer native:dev — confirm Electron launches against nativephp/desktop and the existing menus / windows still appear.
  • Visit /notifications in the dev electron, add/remove a few action rows, edit their text, and click Send — confirm the notification fires with the expected actions.
  • Re-tour the other Livewire screens (Window, MenuBar, ChildProcess, Clipboard, Screen, Dialogs, ContextMenu, Dock, GlobalShortcuts) to confirm no other Native\Laravel\… references were missed.
  • Run php artisan boost:install (interactive) on a fresh checkout to confirm the bundled boost config is what a new contributor would generate.

🤖 Generated with Claude Code

- Swap nativephp/electron + nativephp/laravel for unified nativephp/desktop ^2.0 (L13-compatible)
- Bump laravel/framework to ^13.0 and laravel/tinker to ^2.8|^3.0
- Add laravel/boost ^2.0 (dev) plus generated CLAUDE.md, .mcp.json, boost.json and skills
- Rename Native\Laravel\ -> Native\Desktop\ across providers, listeners, Livewire components, middleware, config
- Update native:dev script to use native:run (native:serve now deprecated)
- Fix Notifications Livewire component: replace fragile $wire.actions.push/splice/[index]
  with addAction/removeAction methods and @foreach + wire:model.live binding (Livewire 3.8
  proxy serializes those paths through toJSON, triggering MethodNotFoundException)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant