承接 pacific-softwares/projectscore 相关项目开发

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

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

pacific-softwares/projectscore

最新稳定版本:v1.0.1

Composer 安装命令:

composer require pacific-softwares/projectscore

包简介

A Laravel package for managing common API configuration and services across multiple Pacific Software projects

README 文档

README

A Laravel package for managing common API configuration and services across multiple Pacific Software projects.

Installation

Install the package via Composer:

composer require pacific-softwares/projectscore

Configuration

The package has a default API base URL set to https://api.pacificsoftwares.com/projectscore/api/v1.

You can override this default by setting PROJECTSCORE_API_BASE_URL in your .env file (optional):

PROJECTSCORE_API_BASE_URL=https://your-custom-api-url.com/projectscore/api/v1
PROJECTSCORE_API_KEY=your-api-key-here
PROJECTSCORE_API_TIMEOUT=30

If PROJECTSCORE_API_BASE_URL is not set in .env, the package will use its default value.

Publishing Config

To publish the config file (optional):

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

This will publish the config to config/projectscore.php.

Usage

Using the Facade

use ProjectsCore\Facades\ProjectsCore;

// Get the API base URL
$baseUrl = ProjectsCore::getBaseUrl();

// Check if API is configured
if (ProjectsCore::isConfigured()) {
    // API is available
}

// Build a full URL from a path
$url = ProjectsCore::url('users/123');

// Make GET request
$response = ProjectsCore::get('users', ['page' => 1]);
$users = $response->json();

// Make POST request
$response = ProjectsCore::post('users', [
    'name' => 'John Doe',
    'email' => 'john@example.com'
]);
$user = $response->json();

// Make PUT request
$response = ProjectsCore::put('users/123', [
    'name' => 'Jane Doe'
]);

// Make PATCH request
$response = ProjectsCore::patch('users/123', [
    'email' => 'jane@example.com'
]);

// Make DELETE request
$response = ProjectsCore::delete('users/123');

Using the Service

use ProjectsCore\Services\ApiService;

$apiService = app('projectscore.api');
$baseUrl = $apiService->getBaseUrl();

// Make requests
$response = $apiService->get('users');
$data = $response->json();

Response Handling

All HTTP methods return an Illuminate\Http\Client\Response instance, which provides various methods:

$response = ProjectsCore::get('users');

// Check if request was successful
if ($response->successful()) {
    $data = $response->json();
}

// Get status code
$statusCode = $response->status();

// Get response body as array
$data = $response->json();

// Get response body as string
$body = $response->body();

// Check for errors
if ($response->failed()) {
    // Handle error
}

Service Provider

The package is automatically registered via Laravel's package discovery.

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固