PHPackages                             vigihdev/support - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vigihdev/support

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vigihdev/support
================

A robust set of utility and helper classes for PHP development, including string manipulation and array helpers.

010PHPCI passing

Since Jan 30Pushed 3mo agoCompare

[ Source](https://github.com/vigihdev/support)[ Packagist](https://packagist.org/packages/vigihdev/support)[ RSS](/packages/vigihdev-support/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

VigihDev Support Library
========================

[](#vigihdev-support-library)

[![Tests](https://github.com/vigihdev/support/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/vigihdev/support/actions/workflows/tests.yml/badge.svg?branch=main)[![Push](https://github.com/vigihdev/support/actions/workflows/push.yml/badge.svg)](https://github.com/vigihdev/support/actions/workflows/push.yml/badge.svg)[![PHP Version](https://camo.githubusercontent.com/cc9cdea9aa96b40a822425e981b0a030e3371202973c7d57b74e8e99834f81dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d626c7565)](https://php.net)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)

A robust set of utility and helper classes for PHP development, including string manipulation, array helpers, file operations, and collections.

Installation
------------

[](#installation)

```
composer require vigihdev/support
```

Requirements
------------

[](#requirements)

- PHP ^8.1
- Symfony String ^6.4

Usage
-----

[](#usage)

### Text Helper

[](#text-helper)

```
use Vigihdev\Support\Text;

// Case conversions
Text::camelCase('hello_world');        // 'helloWorld'
Text::pascalCase('hello_world');       // 'HelloWorld'
Text::snakeCase('HelloWorld');         // 'hello_world'
Text::kebabCase('hello_world');        // 'hello-world'
Text::toTitleCase('hello world');      // 'Hello World'

// String utilities
Text::slugify('Hello World!');         // 'hello-world'
Text::truncate('Long text...', 10);    // 'Long text...'
Text::contains('Hello World', 'World'); // true
Text::random(10);                      // Random 10-char string
Text::toReadableLabel('firstName');    // 'First Name'
```

### Array Helper

[](#array-helper)

```
use Vigihdev\Support\Arr;

$array = [
    'name' => 'John Doe',
    'address' => [
        'street' => '123 Main St',
        'city' => 'Anytown'
    ],
    'emails' => ['john@example.com', 'work@example.com']
];

// Get values with dot notation
Arr::get($array, 'name');              // 'John Doe'
Arr::get($array, 'address.street');    // '123 Main St'
Arr::get($array, 'missing', 'default'); // 'default'

// Check existence
Arr::has($array, 'name');              // true
Arr::has($array, 'address.city');      // true
Arr::exists($array, 'name');           // true

// Array manipulation
Arr::only($array, ['name', 'emails']); // Only specified keys
Arr::except($array, ['address']);      // All except specified keys
Arr::pluck($users, 'name');            // Extract column values
Arr::first($array);                    // First element
Arr::last($array);                     // Last element
Arr::flatten($nested);                 // Flatten nested arrays
Arr::dot($array);                      // Convert to dot notation
```

### Collection

[](#collection)

```
use Vigihdev\Support\Collection;

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

// Basic operations
$collection->count();                   // 5
$collection->isEmpty();                 // false
$collection->toArray();                 // [1, 2, 3, 4, 5]

// Functional methods
$collection->filter(fn($x) => $x > 3);  // [4, 5]
$collection->map(fn($x) => $x * 2);     // [2, 4, 6, 8, 10]
$collection->reduce(fn($carry, $x) => $carry + $x, 0); // 15

// Access methods
$collection->first();                   // 1
$collection->last();                    // 5
$collection->get(2);                    // 3
$collection->has(1);                    // true

// Array methods
$collection->keys();                    // [0, 1, 2, 3, 4]
$collection->values();                  // [1, 2, 3, 4, 5]
$collection->slice(1, 3);               // [2, 3, 4]
$collection->chunk(2);                  // [[1, 2], [3, 4], [5]]

// Advanced operations
$users = new Collection([
    ['name' => 'John', 'age' => 30],
    ['name' => 'Jane', 'age' => 25]
]);
$users->pluck('name');                  // ['John', 'Jane']
$users->groupBy('age');                 // Group by age
$users->sortBy('name');                 // Sort by name

// JSON conversion
$collection->toJson();                  // JSON string
```

### File Helper

[](#file-helper)

```
use Vigihdev\Support\File;

// Read/Write operations
File::get('path/to/file.txt');          // Read file content
File::put('path/to/file.txt', 'content'); // Write to file
File::append('path/to/file.txt', 'more'); // Append to file

// File information
File::exists('path/to/file.txt');       // true/false
File::missing('path/to/file.txt');      // true/false
File::size('path/to/file.txt');         // File size in bytes
File::extension('file.txt');            // 'txt'
File::name('path/to/file.txt');         // 'file.txt'
File::basename('path/to/file.txt');     // 'file'
File::dirname('path/to/file.txt');      // 'path/to'
File::type('path/to/file.txt');         // 'file'
File::mimeType('image.jpg');            // 'image/jpeg'
File::lastModified('file.txt');         // Unix timestamp

// File operations
File::delete('path/to/file.txt');       // Delete file
File::move('old/path.txt', 'new/path.txt'); // Move file
File::copy('source.txt', 'dest.txt');   // Copy file

// Directory operations
File::makeDirectory('path/to/dir');     // Create directory
File::deleteDirectory('path/to/dir');   // Delete directory
File::cleanDirectory('path/to/dir');    // Empty directory
File::files('path/to/dir');             // List files
File::directories('path/to/dir');       // List directories
File::allFiles('path/to/dir');          // Recursive file list
File::allDirectories('path/to/dir');    // Recursive directory list
```

Testing
-------

[](#testing)

```
composer test
```

Development Server
------------------

[](#development-server)

```
composer run server
```

License
-------

[](#license)

MIT License - see [LICENCE](LICENCE) file for details.

Author
------

[](#author)

**Vigih Dev**
Email:

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance53

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/bace572fc25f16fc80012c44703f3000ac48b1238aa82a6316885749f4bcb47f?d=identicon)[vigihdev](/maintainers/vigihdev)

---

Top Contributors

[![vigihdev](https://avatars.githubusercontent.com/u/95208065?v=4)](https://github.com/vigihdev "vigihdev (12 commits)")

### Embed Badge

![Health badge](/badges/vigihdev-support/health.svg)

```
[![Health](https://phpackages.com/badges/vigihdev-support/health.svg)](https://phpackages.com/packages/vigihdev-support)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
