承接 codeitamarjr/laravel-cro-api 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

codeitamarjr/laravel-cro-api

最新稳定版本:0.1.1

Composer 安装命令:

composer require codeitamarjr/laravel-cro-api

包简介

Laravel wrapper for the Irish CRO API with helpers for searching companies and submissions.

README 文档

README

A minimal Laravel wrapper for the Irish Company Registration Office (CRO) API. It provides a fluent client, container binding, and a facade for common CRO lookups.

Install

composer require codeitamarjr/laravel-cro-api

Publish the config if you need to override defaults:

php artisan vendor:publish --tag=cro-api-config

Configuration

Set your credentials (and optionally override the base URL/timeouts) in your .env:

CRO_API_EMAIL=you@example.com
CRO_API_KEY=your-key
CRO_API_BASE_URL=https://services.cro.ie/cws
CRO_API_HTTP_TIMEOUT=15
CRO_API_MAX_PER_PAGE=100
CRO_API_RATE_LIMIT_SLEEP_SECONDS=10
CRO_API_DELAY_BETWEEN_REQUESTS_MS=750

CRO_EMAIL will also be read if CRO_API_EMAIL is not set, keeping compatibility with existing env names.

Usage

Resolve the client out of the container (or use the CroApi facade):

use Codeitamarjr\LaravelCroApi\CroApiClient;
use Codeitamarjr\LaravelCroApi\Facades\CroApi;

// Via dependency injection
public function show(CroApiClient $cro)
{
    $companies = $cro->searchByNumber('123456');
}

// Via facade
$details = CroApi::getCompanyDetails('123456');
$submissions = CroApi::getCompanySubmissions('123456');
$latestByType = CroApi::searchCompanySubmissions('123456'); // paginated + deduped

Testing

Run the package tests locally:

composer install
composer test

Available methods

  • searchByNumber(string $number): array — Filter companies by number.
  • getCompanyDetails(string $number): array — Fetch company profile data.
  • getCompanySubmissions(string $number): array — Retrieve submissions for one company.
  • searchCompanySubmissions(string $number, string $busIndicator = 'c'): array — Paginate through submissions, handling Cloudflare rate limits and returning the latest submission per type.

Testing locally

When working in a single repo, you can point Composer to the path:

composer config repositories.laravel-cro-api path ./packages/laravel-cro-api
composer require codeitamarjr/laravel-cro-api:*

The package is auto-discovered by Laravel; no manual provider registration is needed.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-17