承接 achyutn/laravel-news-sdk 相关项目开发

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

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

achyutn/laravel-news-sdk

Composer 安装命令:

composer require achyutn/laravel-news-sdk

包简介

A simple PHP SDK for submitting links to Laravel News.

README 文档

README

Lint & Test PR

A simple PHP SDK for submitting links to Laravel News using their API.

Requirements

  • PHP 8.1 or higher
  • Laravel 10.0 or higher

Installation

You can install the package via Composer:

composer require achyutn/laravel-news-sdk

Configuration

After installing, publish the configuration file:

php artisan vendor:publish --tag="laravel-news"

This will create a config/laravel-news.php file.

Next, set your Laravel News API token in your .env file:

LARAVEL_NEWS_TOKEN=your-api-token-here

You can obtain an API token from Laravel News.

Usage

Using the Facade

use AchyutN\LaravelNews\Facades\LaravelNews;
use AchyutN\LaravelNews\Data\Link;
use AchyutN\LaravelNews\Enums\LinkCategory;

$link = new Link(
    title: 'Filament Log Viewer',
    url: 'https://packagist.org/packages/achyutn/filament-log-viewer',
    category: LinkCategory::Package
);

$item = LaravelNews::post($link);

// The item is a Link DTO populated with server-side data
echo $item->id;
echo $item->createdAt;

Using Dependency Injection

use AchyutN\LaravelNews\LaravelNews;

class SomeController
{
    public function __construct(
        private LaravelNews $laravelNews
    ) {}

    public function submitLink()
    {
        $link = new Link(
            title: 'Cool Tutorial',
            url: 'https://example.com/tutorial'
        );

        $item = $this->laravelNews->post($link);
    }
}

API Reference

LaravelNews

The main class for interacting with the Laravel News API.

post(Link $link): Link

Submits a link and returns a populated Link instance.

  • Throws: AchyutN\LaravelNews\Exceptions\LaravelNewsException if the API returns an error or the token is missing.

Link

The core Data Transfer Object for submitting links.

Properties:

  • string $title (Required, max 100 chars)
  • string $url (Required, valid URL)
  • LinkCategory|null $category
  • int|null $id (Populated after response)
  • int|null $userId (Populated after response)
  • Carbon|null $createdAt
  • Carbon|null $updatedAt

toPostArray(): array

Converts the DTO into the format expected by the Laravel News API for submission.

fromArray(array $data): self

Creates a Link item from API response data.

LinkCategory

Enum for link categories.

  • LinkCategory::Tutorial
  • LinkCategory::Package

Contributing

Contributions are welcome! Please create a pull request or open an issue if you find any bugs or have feature requests.

License

This package is open-sourced software licensed under the MIT license.

Support

If you find this package useful, please consider starring the repository on GitHub to show your support.

achyutn/laravel-news-sdk 适用场景与选型建议

achyutn/laravel-news-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 354 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 01 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「api」 「sdk」 「news」 「laravel」 「links」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 achyutn/laravel-news-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 achyutn/laravel-news-sdk 我们能提供哪些服务?
定制开发 / 二次开发

基于 achyutn/laravel-news-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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