定制 monstar-lab-oss/n-meta-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

monstar-lab-oss/n-meta-laravel

Composer 安装命令:

composer require monstar-lab-oss/n-meta-laravel

包简介

Laravel SDK for NMeta

README 文档

README

Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status

📝 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

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-03-30