Search by

ArtisanToolbox Core provides shared foundations, contracts, utilities, and common components for all ArtisanToolbox packages.

Package info

github.com/artisan-toolbox/core

pkg:composer/artisan-toolbox/core

Fund package maintenance!

artisan-toolbox

Statistics

Installs: 268

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

1.1.0 2026-09-04 14:40 UTC

This package is auto-updated.

Last update: 2026-09-04 14:41:03 UTC


README

Artisan Toolbox Core

Packagist GitHub Workflow Status (1.x)

Artisan Toolbox Core provides shared foundations, contracts, utilities, and common components for Artisan Toolbox packages.

Documentation

The complete installation, resource publishing, and compatibility documentation is available at artisantoolbox.wsssoftware.com.br/packages/core.

Installation

composer require artisan-toolbox/core

Most applications receive Core through another Artisan Toolbox package. When using it directly, publish its resources with:

php artisan vendor:publish --tag="core"

Usage

Build arrays with conditionally included values using the Arr::sift() macro and namespaced sift_when() helper:

use Illuminate\Support\Arr;

use function ArtisanToolbox\Core\sift_when;

$payload = Arr::sift([
    'name' => $user->name,
    'email' => sift_when($canViewEmail, fn (): string => $user->email),
]);

The macro is also available as $collection->sift() and $lazyCollection->sift(), returning new instances without mutating or eagerly consuming their sources.

See the conditional arrays documentation for recursive iterable behavior and key-preservation details.

Resources