承接 forjix/support 相关项目开发

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

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

forjix/support

最新稳定版本:0.1.0

Composer 安装命令:

composer require forjix/support

包简介

Forjix Framework support utilities

README 文档

README

Utility classes and helper functions for the Forjix framework.

Installation

composer require forjix/support

Collections

Fluent wrapper for working with arrays of data.

use Forjix\Support\Collection;

$collection = collect([1, 2, 3, 4, 5]);

$filtered = $collection
    ->filter(fn($n) => $n > 2)
    ->map(fn($n) => $n * 2)
    ->values();
// [6, 8, 10]

// Available methods
$collection->first();
$collection->last();
$collection->count();
$collection->isEmpty();
$collection->pluck('name');
$collection->groupBy('category');
$collection->sortBy('name');
$collection->unique();
$collection->flatten();

Array Helpers

use Forjix\Support\Arr;

Arr::get($array, 'user.name', 'default');
Arr::set($array, 'user.name', 'John');
Arr::has($array, 'user.email');
Arr::only($array, ['name', 'email']);
Arr::except($array, ['password']);
Arr::flatten($array);
Arr::dot($array);

String Helpers

use Forjix\Support\Str;

Str::camel('hello_world');      // helloWorld
Str::snake('helloWorld');       // hello_world
Str::kebab('helloWorld');       // hello-world
Str::studly('hello_world');     // HelloWorld
Str::slug('Hello World');       // hello-world
Str::contains('Hello', 'ell'); // true
Str::startsWith('Hello', 'He'); // true
Str::endsWith('Hello', 'lo');   // true
Str::random(16);                // random string

Pipeline

Chain operations on a value.

use Forjix\Support\Pipeline;

$result = (new Pipeline())
    ->send($request)
    ->through([
        AuthMiddleware::class,
        LoggingMiddleware::class,
    ])
    ->then(fn($request) => $handler->handle($request));

Fluent

Fluent interface for building configuration objects.

use Forjix\Support\Fluent;

$config = new Fluent(['name' => 'App']);
$config->version('1.0');
echo $config->name; // App

License

GPL-3.0

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2026-01-05