定制 onmagik/laravel-client 二次开发

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

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

onmagik/laravel-client

最新稳定版本:v1.0.0

Composer 安装命令:

composer require onmagik/laravel-client

包简介

Laravel client package for ON Platform integration - Magik powered

README 文档

README

Official Laravel package for integrating with ON Platform - Powered by Magik.

Latest Version License

Features

  • ✨ Magik-powered integration with ON Platform
  • 🚀 Easy setup and configuration
  • 🔐 Secure API authentication
  • 📦 Support for all ON packages (Move, Blog, Analytics, Pay)
  • 💾 Built-in caching
  • 🎯 Simple facade interface
  • 📝 Comprehensive logging

Installation

composer require onmagik/laravel-client

Configuration

Publish the config file:

php artisan vendor:publish --tag=on-config

Add to your .env:

ON_API_URL=https://on.test/api
ON_API_KEY=your_api_key_here
ON_SITE_ID=1
ON_VERIFY_SSL=false

Usage

Using Facade

use OnMagik\LaravelClient\Facades\ON;

// Health check
$health = ON::health();

// Get site info
$siteInfo = ON::getSiteInfo();

// Calculate estimate (ON Move) ✨
$estimate = ON::calculateEstimate([
    'volume' => 12,
    'distance_km' => 50,
    'weight_kg' => 600,
]);

Using Dependency Injection

use OnMagik\LaravelClient\Services\ONClient;

class MovingController extends Controller
{
    public function __construct(
        protected ONClient $on
    ) {}
    
    public function calculate(Request $request)
    {
        $result = $this->on->calculateEstimate([
            'volume' => $request->volume,
            'distance_km' => $request->distance_km,
            'weight_kg' => $request->weight_kg,
        ]);
        
        return response()->json($result);
    }
}

Credits

License

The MIT License (MIT). See License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-25