- How do I install MobileKit in a Laravel application?
- Install it with Composer using composer require jeffersongoncalves/mobilekit. The package is Laravel-native and registers its service provider and configuration through the framework. After installation, publish the configuration if you need to customize detection rules or middleware behavior, then review the README for any scaffold-specific commands. For the v3.3.56 scaffold path, follow the package's documented generation steps rather than assuming a drop-in library install.
- Which Laravel versions does MobileKit support?
- The package description targets Laravel, and the TPM assessment notes a Laravel 13 target that should be verified against composer.json rather than release-note prose. The evaluated v3.3.56 stack also references Filament 3.3.56, NativePHP Mobile 4.3.0, and PHP 8.4 in CI. Check the composer.json require block for the exact Laravel, PHP, Filament, and NativePHP constraints before installing. Do not assume support for older Laravel versions without confirming the constraint.
- How do I detect mobile and tablet devices with MobileKit in Laravel?
- MobileKit provides a Laravel-native API for detecting mobile, tablet, and desktop requests. You can use the package's helpers in controllers, middleware, or Blade to branch on device type. Detection is driven by configurable user-agent rules so you can extend or override the defaults. Keep device-specific logic out of controllers by centralizing it in middleware or view composers where possible.
- What Blade directives and helpers does MobileKit provide for mobile markup?
- The package ships Blade directives and helpers for conditional mobile markup, so you can render mobile-only or desktop-only sections directly in templates. The exact directive names and helper signatures should be taken from the README or source for the version you install. Use them for presentation-level branching only; keep redirects and response tailoring in middleware. This keeps templates readable and avoids scattering user-agent checks across views.
- Can MobileKit middleware redirect mobile users to a separate route or view?
- Yes, the package includes middleware intended for redirects or tailored responses based on device detection. Register the middleware in your HTTP kernel or route group and configure the redirect targets or response behavior through the package config. Because the TPM assessment flags breaking changes in patch releases, test middleware behavior after every upgrade. Avoid hard-coding redirects in controllers when the middleware can own that decision.
- How do I configure custom user-agent detection rules in MobileKit?
- MobileKit exposes Laravel-native configuration for user-agent and custom detection rules. Publish the config file, then add or override the patterns used to classify mobile, tablet, and desktop requests. Keep custom rules version-controlled and covered by tests with representative user-agent strings. If you need request-specific overrides, prefer middleware or a dedicated detector service over editing vendor files.
- Is MobileKit a device-detection library or a Laravel application scaffold?
- The package overview describes a lightweight device-detection library with Blade directives, middleware, and configurable rules. The TPM assessment for v3.3.56 describes a Laravel application-scaffolding package that pairs a Filament v3 admin panel with a NativePHP Mobile shell and ships user/admin models and login wiring. Those are materially different adoption models, so confirm which surface you are installing by reading composer.json, the README, and the tagged source. Treat the scaffold path as fork-and-own code, not a clean versioned dependency.
- Can I keep my existing User model and auth guard when using MobileKit?
- The TPM assessment flags PR #118 as making the package assume its own user/admin domain rather than deferring to an existing one, and that change landed in a patch release. It is not documented in the provided context as opt-in or forced, so you must verify before commitment. If the scaffold overwrites or reconciles auth models, you would be maintaining two auth domains. For an existing application, pilot on a throwaway app and diff the generated output against your conventions first.
- Which Filament and NativePHP Mobile versions does MobileKit v3.3.56 use?
- The evaluated v3.3.56 stack pins Filament 3.3.56 and NativePHP Mobile 4.3.0, with PHP 8.4 in CI. Filament 4 exists, and the TPM assessment notes no visible upstream v4 track, so upgrade debt would accrue to your team. NativePHP Mobile moved from 4.2.0 to 4.3.0 on a minor line and is described as the least stable surface. Verify exact constraints in composer.json and test native build reproducibility in your CI.
- Is MobileKit production-ready, and how should I handle upgrades and testing?
- The TPM assessment recommends a time-boxed pilot on a non-critical internal admin, not adoption as a versioned dependency on a revenue-path application. Semantic versioning is described as not observable, with a structural auth/model change shipped in a patch, so treat every release as potentially breaking. Test device detection with representative mobile, tablet, and desktop user agents, and test the Filament and NativePHP build paths separately. If you adopt, vendor or fork at a pinned commit and own the diffs; also confirm the PHPStan level and CI static-analysis behavior.