onmagik/laravel-client

Laravel client package for ON Platform integration - Magik powered

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/onmagik/laravel-client

v1.0.0 2025-10-25 01:58 UTC

This package is not auto-updated.

Last update: 2026-01-04 01:38:52 UTC


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.