nativemobile/laravel-mobile-ui 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nativemobile/laravel-mobile-ui

Composer 安装命令:

composer require nativemobile/laravel-mobile-ui

包简介

PHP-first mobile UI package for Android WebView — Alpine.js + Livewire v4 components

README 文档

README

<<<<<<< HEAD

php-mobile-ui — Laravel Mobile UI Package

======= <<<<<<< HEAD

Laravel Native Mobile UI

46a38dd77910e6d7e54f8f3015560b957cfdd758

A PHP-first, mobile-native UI component library for Laravel + Livewire v4 Built by Elegant Media for Android WebView and NativePHP applications.

🎯 One-Year Vision

This package powers the mobile storefront experience for two Elegant Media brands:

Brand Product Goal
Elegant Media Internal tooling & client apps A premium PHP component SDK that competes with Flutter's widget philosophy, without leaving Laravel
The Appliance Store Consumer-facing mobile commerce A high-performance product browsing, cart, and checkout UI entirely driven by Livewire v4 components

📦 Installation

composer require nativemobile/laravel-mobile-ui

The package auto-discovers its service provider via Laravel's package auto-discovery.

🗺️ Phased Roadmap

✅ Phase 1 — Foundation (Q1 2026)

Goal: Solid base that all future components inherit from.

  • Widget — Abstract base class with fluent CSS API and Htmlable integration:
    • Spacing: ->padding(), ->paddingX(), ->paddingY(), ->margin(), ->marginX(), ->marginY()
    • Appearance: ->background(), ->color(), ->borderRadius(), ->opacity(), ->shadow()
    • Layout: ->width(), ->height(), ->overflow()
    • Identity: ->id(), ->class(), ->attr()
  • Stylable contract — defines the fluent style interface
  • Renderable contract — render(): string
  • Htmlable integration — toHtml() and __toString() for seamless Blade rendering
// Works directly in Blade templates
{!! TextView::make()->text('Hello, World!')->padding('16px')->background('#6200EE')->color('#fff') !!}

// Or as a Blade variable (Htmlable autorender)
$widget = TextView::make()->text('Hello')->padding('16px');
// {{ $widget }} works without {!! !!} escaping issues

✅ Phase 2 — Layouts (Q1–Q2 2026)

Goal: Flutter-style declarative layout primitives.

Component Description
Column Vertical flex layout. mainAxisAlignment, crossAxisAlignment, gap, scrollable
Row Horizontal flex layout. Same API, adds wrap, horizontal scrollable
Stack Absolute-positioned layers with 9-point alignment grid
Scaffold Full-screen page shell composing AppBar + body + BottomNavigation + FAB
Scaffold::make()
    ->appBar(AppBar::make()->title('Products')->withDrawer())
    ->body(
        Column::make()
            ->padding('16px')
            ->gap('12px')
            ->scrollable()
            ->children($productWidgets)
    )
    ->bottomNav(
        BottomNavigation::make()
            ->tabs(config('mobile-nav.bottom'))
            ->active('products')
            ->badges(['cart' => $cartCount])
    )

✅ Phase 3 — Navigation (Q2 2026)

Goal: Persistent, state-aware navigation with real-time badge counters.

Component Feature
BottomNavigation Real-time badge counters (dot for 1, numeric for 2–99, "99+" cap). Livewire reactive via wire:click.
NavigationDrawer Side-panel with per-item badge support, Alpine.js open/close, Android back-button integration
AppBar Android status bar color sync, drawer toggle, back button, action slots
// Real-time cart badge via Livewire property
BottomNavigation::make()
    ->tabs(config('mobile-nav.bottom'))
    ->active($this->activeTab)
    ->livewire('switchTab')
    ->badges([
        'cart'          => $this->cartCount,       // Updates reactively
        'notifications' => $this->unreadCount,
    ])
    ->badgeColor('#E53935')

✅ Phase 4 — Data (Q2–Q3 2026)

Goal: High-performance data rendering using the itemBuilder pattern from Flutter.

ListView — Closure-based list rendering:

ListView::make()
    ->items($this->products)
    ->itemBuilder(function (array $product, int $index): string {
        return Card::make()
            ->title($product['name'])
            ->subtitle('$' . $product['price'])
            ->render();
    })
    ->separator('#f0f0f0')
    ->onScrollEnd('loadMore')   // Livewire infinite scroll
    ->padding('0 16px')

🔜 Phase 5 — Livewire Single-File Components (Q3 2026)

Goal: .wire.php single-file components for reactive native-feel interactions.

  • <livewire:mobile.product-list /> — SFC with virtual scroll
  • <livewire:mobile.cart-drawer /> — Persistent cart state
  • <livewire:mobile.search-bar /> — Debounced live search
  • NativePHP v3.1 EDGE tag integration for hardware haptics and status bar

🔜 Phase 6 — Native Bridge (Q4 2026)

Goal: Deep NativePHP v3.1 integration for a true native feel.

  • AndroidBridge JS interface wrappers (haptics, status bar, camera, file picker)
  • Push notification bridge with Livewire event syncing
  • NativeGestureDetector for swipe, long-press, and pinch

🧩 Component Catalogue

Layout

Class Description
AppBar Fixed top bar with status bar color sync
BottomNavigation Tab bar with badge counters
NavigationDrawer Slide-in side menu
Column Vertical flex layout
Row Horizontal flex layout
Stack Layered absolute positioning
Scaffold Full-screen page shell
Modal Bottom sheet / dialog

UI

Class Description
TextView Styled text with typography helpers
Button Tap targets with haptic feedback
Card Elevated content container
Image Lazy-loaded with srcset
Carousel Touch-swipe with Alpine.js
ListView itemBuilder list renderer
ProgressBar Linear or circular
Slider Range input
Link Accessible anchors

🧪 Testing

Tests live in packages/php-mobile-ui/tests/ and run via Pest v4.

# From the Laravel app root
php artisan test --compact --filter=mobile-ui

# From the package directory
./vendor/bin/pest

Coverage:

  • WidgetStylingTest — 15 tests covering all fluent CSS properties
  • ColumnRowTest — 14 tests for Column, Row, Stack layouts
  • ListViewTest — 11 tests for itemBuilder, separators, scroll wiring

⚙️ Configuration

php artisan vendor:publish --tag=mobile-ui-config

Edit config/mobile-ui.php to define your navigation tabs, brand colors, and NativePHP bridge settings.

🏢 Credits

Developed and maintained by Elegant Mediaelegantmedia.com.au

  • Mobile commerce platform: The Appliance Store
  • Architecture: Mobile-first Laravel with Livewire v4
  • Target runtime: Android WebView via NativePHP v3.1

Licensed MIT. PHP 8.2+ required.

nativemobile/laravel-mobile-ui 适用场景与选型建议

nativemobile/laravel-mobile-ui 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 20 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「ui」 「components」 「mobile」 「laravel」 「android」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 nativemobile/laravel-mobile-ui 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 nativemobile/laravel-mobile-ui 我们能提供哪些服务?
定制开发 / 二次开发

基于 nativemobile/laravel-mobile-ui 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 26
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-20