playroom/livewire-adapter
最新稳定版本:v1.0.1
Composer 安装命令:
composer require playroom/livewire-adapter
包简介
Livewire adapter package for PlayRoom built on the Alpine adapter
README 文档
README
Laravel package that exposes PlayRoom as a Livewire 4 component.
Requirements
- PHP 8.3+
- Laravel 13+
- Livewire 4+
Installation
Require the package:
composer require playroom/livewire-adapter
Laravel package discovery will register PlayRoom\\LivewirePlayRoom\\LivewirePlayRoomServiceProvider automatically.
Add the package JavaScript entry to your application's vite.config.js inputs so Laravel Vite includes it in the manifest:
laravel({ input: [ 'resources/css/app.css', 'resources/js/app.js', 'vendor/playroom/livewire-adapter/resources/js/playroom-init.js', ], refresh: true, })
Usage
Render the component in Blade:
<livewire:play-room />
Or mount it directly with custom options:
@livewire(\PlayRoom\LivewirePlayRoom\LivewirePlayRoom::class, [ 'playRoomLocale' => 'en', 'playRoomTheme' => 'light', 'playRoomOptions' => [ 'browserStartMode' => 'inline', 'launcher' => [ 'mode' => 'inline', ], 'themeColors' => [ 'primary' => '#0f766e', 'secondary' => '#475569', ], ], 'playRoomUseDefaultGames' => true, 'playRoomDefaultGamesConfig' => [], 'playRoomGameRegistrars' => [], ])
Supported Props
playRoomLocaleplayRoomThemeplayRoomOptionsplayRoomWrapperClassplayRoomContainerClassplayRoomUseDefaultGamesplayRoomDefaultGamesConfigplayRoomGameRegistrars
Notes
- The package loads the
vendor/playroom/livewire-adapter/resources/js/playroom-init.jsVite entry from the consuming Laravel app. - The consuming Laravel app must add that same path to the Vite
inputarray, otherwise the asset will not exist inpublic/build/manifest.json. - This adapter expects the underlying PlayRoom Alpine integration to be available in the host application.
- Locale and theme changes stay synchronized between the PlayRoom instance and Livewire.
统计信息
- 总下载量: 38
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-23