monstar-lab-oss / n-meta-laravel
Laravel SDK for NMeta
Installs: 14 276
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 1
Open Issues: 1
Requires
- php: ^8.0
- monstar-lab-oss/n-meta-php: ^2.0.0
Requires (Dev)
- mockery/mockery: dev-master
- orchestra/testbench: ~3.4
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2025-07-13 18:10:11 UTC
README
📝 Introduction
Package to enforce & parse Meta header (Default: "Client-Meta-Information")
Client-Meta-Information: [PLATFORM];[ENVIRONMENT];[APP_VERSION];[DEVICE_OS];[DEVICE]
📦 Installation
To install this package you will need:
- PHP 7.1+
Run
composer require monstar-lab-oss/n-meta-laravel
or setup in composer.json
monstar-lab-oss/n-meta-laravel: 1.0.x
In config/app.php
(Laravel) or bootstrap/app.php
(Lumen) you should add service provider
NMeta\ServiceProvider::class
Copy config over from vendor/monstar-lab-oss/n-meta-laravel/config/n-meta.php to project/config/n-meta.php
php artisan vendor:publish --provider="NMeta\ServiceProvider"
⚙ Usage
Add middleware to routes:
// in RouteServiceProvider protected function mapApiRoutes() { Route::prefix('api') ->middleware('api') ->middleware(NMetaMiddleware::class) // Add NMeta middleware ->namespace($this->namespace) ->group(base_path('routes/api.php')); }
You can now call via function, eg:
nmeta()->getPlatform() nmeta()->getVersion()
🏆 Credits
This package is developed and maintained by the PHP team at Monstar Lab
📄 License
This package is open-sourced software licensed under the MIT license