masmerise/scrada-for-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

masmerise/scrada-for-laravel

最新稳定版本:1.3.0

Composer 安装命令:

composer require masmerise/scrada-for-laravel

包简介

Laravel framework adapter for the Scrada SDK.

README 文档

README

Scrada PHP SDK Laravel

Build Status Total Downloads Latest Stable Version License

Laravel adapter for the Scrada SDK

This package provides convenient access to the Scrada SDK using the Laravel framework.

Installation

You can install the package via composer:

composer require masmerise/scrada-for-laravel

After that, define your scrada credentials inside the config/services.php configuration file:

'scrada' => [
    'default' => env('SCRADA_COMPANY', 'default'),
    
    'companies' => [
        'default' => [
            'api_key' => env('SCRADA_API_KEY'),
            'password' => env('SCRADA_PASSWORD'),
            'env' => env('SCRADA_ENV', 'production'), // or 'test'
        ],
    ],
],

Usage

// Resolve a Scrada instance for a specific company
$company = scrada('default')->company->get($id);
// Resolve the manager and use the default company
$scrada = app('scrada');

$company = $scrada->company('default')->company->get($id);
use Scrada\Company\Type\Primitive\CompanyId;
use Scrada\Laravel\ScradaManager;

final readonly class CompanyController
{
    private function __construct(private ScradaManager $scrada) {}
    
    public function show(string $company, string $id): void
    {
        $id = CompanyId::fromString($id);
    
        return view('company.show', [
            'company' => $this->scrada->company($company)->company->get($id),
        ]);
    }
}

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security

If you discover any security related issues, please email support@masmerise.be instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

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