PHPackages                             tamedevelopers/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. tamedevelopers/support

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

tamedevelopers/support
======================

Support Package For PHP and PHP Frameworks

5.1.27(2mo ago)13263MITPHPPHP &gt;=8.0

Since Sep 24Pushed 1mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (10)Versions (93)Used By (3)

Support Package
===============

[](#support-package)

Support Package For PHP, Laravel and PHP Frameworks

[![Total Downloads](https://camo.githubusercontent.com/134e07684b113bd87922331af54a6da55295ed06c1d6ce993020215a30066bfd/68747470733a2f2f706f7365722e707567782e6f72672f74616d65646576656c6f706572732f737570706f72742f646f776e6c6f616473)](https://packagist.org/packages/tamedevelopers/support)[![Latest Stable Version](https://camo.githubusercontent.com/2115de9057ce7dc47434f712f3724085828f612d3e244d2813c2240e525b5eee/68747470733a2f2f706f7365722e707567782e6f72672f74616d65646576656c6f706572732f737570706f72742f76657273696f6e)](https://packagist.org/packages/tamedevelopers/support)[![License](https://camo.githubusercontent.com/3a4ff8e469859d489070e9c232f3927f27c8ad30b5237d1a3d0a2cd5c8f5f5fc/68747470733a2f2f706f7365722e707567782e6f72672f74616d65646576656c6f706572732f737570706f72742f6c6963656e7365)](https://packagist.org/packages/tamedevelopers/support)

Documentation
-------------

[](#documentation)

- [Requirements](#requirements)
- [Installation](#installation)
- [All Paths](#all-paths)
- [Number to Words](#number-to-words)
    - [Iso](#iso)
    - [Cents](#Cents)
    - [Value](#value)
    - [toText](#toText)
    - [toNumber](#toNumber)
    - [allCurrency](#allCurrency)
    - [getCurrencyByCode](#getCurrencyByCode)
- [Tame](#tame)
    - [byteToUnit](#byteToUnit)
    - [unitToByte](#unitToByte)
    - [fileTime](#fileTime)
    - [exists](#exists)
    - [unlink](#unlink)
    - [mask](#mask)
    - [imageToBase64](#imageToBase64)
    - [platformIcon](#platformIcon)
    - [paymentIcon](#paymentIcon)
    - [calPercentageBetweenNumbers](#calPercentageBetweenNumbers)
    - [formatNumberToNearestThousand](#formatNumberToNearestThousand)
    - [calculateVolumeWeight](#calculateVolumeWeight)
    - [calculateCubicMeterWeight](#calculateCubicMeterWeight)
    - [getBetweenBoxLengthAndWeightInKg](#getBetweenBoxLengthAndWeightInKg)
    - [getBetweenBoxLengthAndWeightInCMB](#getBetweenBoxLengthAndWeightInCMB)
- [Str](#str)
    - [Usage](#str-usage)
    - [phone](#phone)
    - [mask](#mask)
    - [html](#html)
    - [text](#text)
    - [shorten](#shorten)
    - [random](#random)
    - [formatString](#formatString)
    - [formatOnlyString](#formatOnlyString)
    - [encrypt](#encrypt)
    - [decrypt](#decrypt)
    - [bindings](#bindings)
    - [flattenValue](#flattenValue)
    - [exceptArray](#exceptArray)
    - [replaceFirst](#replaceFirst)
    - [replaceLast](#replaceLast)
    - [renameArrayKeys](#renameArrayKeys)
    - [forgetArrayKeys](#forgetArrayKeys)
    - [changeKeyCase](#changeKeyCase)
    - [convertArrayCase](#convertArrayCase)
    - [padLeft](#padLeft)
    - [padRight](#padRight)
    - [words](#words)
    - [ascii](#ascii)
    - [is](#is)
    - [snake](#snake)
    - [camel](#camel)
    - [kebab](#kebab)
    - [title](#title)
    - [studly](#studly)
    - [slugify](#slugify)
    - [slug](#slug)
    - [before](#before)
    - [after](#after)
    - [between](#between)
    - [contains](#contains)
    - [truncate](#truncate)
    - [reverse](#reverse)
    - [count](#count)
    - [countOccurrences](#countOccurrences)
    - [uuid](#uuid)
    - [randomWords](#randomWords)
    - [extension](#extension)
    - [wrap](#wrap)
    - [head](#head)
    - [last](#last)
- [TextSanitizer](#TextSanitizer)
    - [Usage](#sanitizer-usage)
    - [phoneInt](#phoneInt)
    - [phoneWords](#phoneWords)
    - [url](#sanitize-url)
    - [email](#sanitize-email)
    - [mention](#sanitize-mention)
    - [hastag](#sanitize-hastag)
    - [sanitize](#sanitize)
    - [findPhoneWords](#findPhoneWords)
- [Utility](#Utility)
    - [Usage](#utility-usage)
    - [getText](#getText)
    - [readingTime](#readingTime)
    - [wordCount](#wordCount)
    - [charCount](#charCount)
    - [sentenceCount](#sentenceCount)
    - [reverse](#utility-reverse)
    - [normalizeEmail](#normalizeEmail)
    - [validateEmail](#validateEmail)
    - [maskEmail](#maskEmail)
    - [equalsEmail](#equalsEmail)
    - [isGmail](#isGmail)
    - [isOutlook](#isOutlook)
    - [isIcloud](#isIcloud)
    - [isFastmail](#isFastmail)
    - [isProtonmail](#isProtonmail)
    - [isZoho](#isZoho)
    - [isYandex](#isYandex)
    - [isGmx](#isGmx)
    - [isMailDotCom](#isMailDotCom)
    - [isMailboxOrg](#isMailboxOrg)
    - [isPosteo](#isPosteo)
    - [isRunbox](#isRunbox)
    - [isStartmail](#isStartmail)
- [Country](#country)
    - [Usage](#country-usage)
    - [iso3](#country-iso3)
    - [iso2](#country-iso2)
    - [flagIso3](#country-flagIso3)
    - [flagIso2](#country-flagIso2)
    - [month](#country-month)
    - [week](#country-week)
    - [zone](#country-zone)
    - [captcha](#country-captcha)
- [File](#file)
    - [Usage](#file-usage)
    - [files](#file-files)
    - [makeDirectory](#file-makedirectory)
    - [exists](#file-exists)
    - [get](#file-get)
    - [put](#file-put)
    - [delete](#file-delete)
    - [copy](#file-copy)
    - [move](#file-move)
    - [size](#file-size)
    - [lastModified](#file-lastmodified)
    - [extension](#file-extension)
    - [name](#file-name)
    - [base](#file-base)
    - [mimeType](#file-mimetype)
    - [type](#file-type)
    - [permissions](#file-permissions)
    - [isReadable](#file-isreadable)
    - [isWritable](#file-iswritable)
    - [isDirectory](#file-isdirectory)
    - [isFile](#file-isfile)
    - [isFileType](#file-isfiletype)
- [ReceiptGenerator](#ReceiptGenerator)
    - [Usage](#ReceiptGenerator-usage)
    - [setData](#ReceiptGenerator-setData)
    - [setDPI](#ReceiptGenerator-setDPI)
    - [badge](#ReceiptGenerator-badge)
    - [generate](#ReceiptGenerator-generate)
    - [setDesign](#ReceiptGenerator-setDesign)
    - [setPaperSize](#ReceiptGenerator-setPaperSize)
    - [setFontFiles](#ReceiptGenerator-setFontFiles)
    - [setOutputFormat](#ReceiptGenerator-setOutputFormat)
    - [outputToBrowser](#ReceiptGenerator-outputToBrowser)
    - [saveToFile](#ReceiptGenerator-saveToFile)
- [Collection](#collection)
    - [Usage](#collection-usage)
    - [has](#collection-has)
    - [count](#collection-count)
    - [all](#collection-all)
    - [isNotEmpty](#collection-isnotempty)
    - [isEmpty](#collection-isempty)
    - [isSame](#collection-issame)
    - [isDuplicate](#collection-isduplicate)
    - [reverse](#collection-reverse)
    - [pad](#collection-pad)
    - [combine](#collection-combine)
    - [collapse](#collection-collapse)
    - [flatten](#collection-flatten)
    - [zip](#collection-zip)
    - [merge](#collection-merge)
    - [only](#collection-only)
    - [except](#collection-except)
    - [chunk](#collection-chunk)
    - [keys](#collection-keys)
    - [values](#collection-values)
    - [filter](#collection-filter)
    - [reject](#collection-reject)
    - [where](#collection-where)
    - [whereIn](#collection-wherein)
    - [whereNotIn](#collection-wherenotin)
    - [whereNull](#collection-wherenull)
    - [whereNotNull](#collection-wherenotnull)
    - [first](#collection-first)
    - [firstWhere](#collection-firstwhere)
    - [last](#collection-last)
    - [startsWith](#collection-startsWith)
    - [endsWith](#collection-endsWith)
    - [matchesAnyPrefixOf](#collection-matchesAnyPrefixOf)
    - [contains](#collection-contains)
    - [doesntContain](#collection-doesntcontain)
    - [every](#collection-every)
    - [some](#collection-some)
    - [select](#collection-select)
    - [map](#collection-map)
    - [mapWithKeys](#collection-mapwithkeys)
    - [pluck](#collection-pluck)
    - [pluckDot](#collection-pluckdot)
    - [groupBy](#collection-groupby)
    - [search](#collection-search)
    - [sort](#collection-sort)
    - [sortBy](#collection-sortby)
    - [sortByMany](#collection-sortbymany)
    - [sortByDesc](#collection-sortbydesc)
    - [sortKeys](#collection-sortkeys)
    - [sortKeysDesc](#collection-sortkeysdesc)
    - [keyBy](#collection-keyby)
    - [slice](#collection-slice)
    - [take](#collection-take)
    - [takeUntil](#collection-takeuntil)
    - [skip](#collection-skip)
    - [concat](#collection-concat)
    - [union](#collection-union)
    - [toBase](#collection-tobase)
    - [pipe](#collection-pipe)
    - [crossJoin](#collection-crossjoin)
    - [join](#collection-join)
    - [unique](#collection-unique)
    - [each](#collection-each)
    - [forget](#collection-forget)
    - [changeKeyCase](#collection-changekeycase)
    - [reduce](#collection-reduce)
    - [shuffle](#collection-shuffle)
    - [partition](#collection-partition)
    - [tap](#collection-tap)
    - [chunkWhile](#collection-chunkwhile)
    - [nth](#collection-nth)
    - [paginate](#collection-paginate)
    - [zipWith](#collection-zipwith)
    - [countBy](#collection-countby)
    - [duplicates](#collection-duplicates)
    - [shuffleKeys](#collection-shufflekeys)
    - [average](#collection-average)
    - [avg](#collection-avg)
    - [sum](#collection-sum)
    - [max](#collection-max)
    - [min](#collection-min)
- [Mail](#mail)
    - [config](#config)
    - [to](#to)
    - [from](#from)
    - [driver](#driver)
    - [provider](#provider)
    - [subject](#subject)
    - [altBody](#altBody)
    - [body](#body)
    - [cc](#cc)
    - [bcc](#bcc)
    - [replyTo](#replyTo)
    - [attach](#attach)
    - [delete](#delete)
    - [send](#send)
    - [flush](#flush)
    - [obFlush](#obFlush)
    - [convert](#convert)
- [Zip](#zip)
    - [Unzip](#unzip)
    - [Zip Download](#zip-download)
- [PDF](#pdf)
    - [Usage](#pdf-usage)
    - [Read PDF](#read-pdf)
- [Time](#time)
    - [time-usage](#time-usage)
    - [now](#now)
    - [date](#date)
    - [today](#today)
    - [yesterday](#yesterday)
    - [createFromFormat](#createFromFormat)
    - [createFromDateString](#createFromDateString)
    - [timestamp](#timestamp)
    - [toJsTimer](#toJsTimer)
    - [format](#format)
    - [toDateTimeString](#toDateTimeString)
    - [toDateString](#toDateString)
    - [toTimeString](#toTimeString)
    - [toDateInt](#toDateInt)
    - [diff](#diff)
    - [diffBetween](#diffBetween)
    - [ago](#ago)
    - [range](#range)
    - [addSeconds](#addSeconds)
    - [subSeconds](#subSeconds)
    - [addMinutes](#addMinutes)
    - [subMinutes](#subMinutes)
    - [addHours](#addHours)
    - [subHours](#subHours)
    - [addDays](#addDays)
    - [subDays](#subDays)
    - [addWeeks](#addWeeks)
    - [subWeeks](#subWeeks)
    - [addMonths](#addMonths)
    - [subMonths](#subMonths)
    - [addYears](#addYears)
    - [subYears](#subYears)
    - [greeting](#greeting)
    - [allTimezone](#allTimezone)
    - [setTimeZone](#setTimeZone)
    - [getTimeZone](#getTimeZone)
- [HttpRequest](#HttpRequest)
    - [url](#url)
    - [http](#http)
    - [host](#host)
    - [full](#full)
    - [path](#path)
    - [server](#http-server)
    - [request](#request)
    - [referral](#referral)
- [Cookie](#cookie)
    - [Usage](#cookie-usage)
    - [set](#cookie-set)
    - [get](#cookie-get)
    - [forget](#cookie-forget)
    - [expire](#cookie-expire)
    - [all](#cookie-all)
    - [has](#cookie-has)
- [Hash](#hash)
    - [Usage](#hash-usage)
    - [make](#hash-make)
    - [check](#hash-check)
- [Asset](#Asset)
    - [Asset config](#asset-config)
        - [Asset Cache](#asset-cache)
- [Laravel](#laravel)
    - [Blade Directives](#blade-directives)
- [View](#view)
    - [Usage](#view-usage)
    - [Support](#view-support)
    - [Helper tview](#view-helper)
- [Env](#env)
    - [Env Create](#env-create)
    - [Env Load](#env-load)
    - [Env Update](#env-update)
- [Manager](#manager)
    - [Key Management](#key-management)
    - [Helper tmanager](#helper-tmanager)
- [Server](#server)
    - [Get Servers](#get-servers)
    - [Create Custom Config](#create-custom-config)
    - [Create Config Template File](#create-config-template-file)
- [Autoload Register](#autoload-register)
- [Helpers Functions](#helpers-functions)
- [Error Dump](#error-dump)
- [Error Status](#error-status)
- [Useful links](#useful-links)

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

[](#requirements)

- `>= php 8.0+`

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

[](#installation)

Prior to installing `support package` get the [Composer](https://getcomposer.org) dependency manager for PHP because it'll simplify installation.

```
composer require tamedevelopers/support

```

All Paths
---------

[](#all-paths)

function nameDescriptionbase\_path()Get absolute base directory path. Accepts a param `string` if given, and append to pathdirectory()Thesame as `base_path()`public\_path()Root/public path. Accepts a param `string` if given, and append to pathstorage\_path()Root/storage path. Accepts a param `string` if given, and append to pathapp\_path()Root/app path. Accepts a param `string` if given, and append to pathconfig\_path()Root/config path. Accepts a param `string` if given, and append to pathlang\_path()Root/lang path. Accepts a param `string` if given, and append to pathdomain()Returns domain URI. Accepts a param `string` if given, and append to pathNumber to Words
---------------

[](#number-to-words)

- Has three chainable methods
    - Can translate all the way to `vigintillion`
    - It's helper class can be called, using -- `NumberToWords()`

[![Sample Units](https://raw.githubusercontent.com/tamedevelopers/support/master/thousand_units.png)](https://raw.githubusercontent.com/tamedevelopers/support/master/thousand_units.png)

Currency (iso-4217) codecentsnumber`NGN | EUR | USD      ``true | false``int|float|string`If `iso` is given and found, it'll automatically converts the text into a currency formatIf you want the decimals to be translated to text as well.numeric figures: `299 | '42,982' | 3200.98`### Iso

[](#iso)

- Takes param as `string` and case-insensitive

```
NumberToWords::iso('ngn');
```

### Cents

[](#cents)

- Takes param as `boolean`. Default is `false`
    - By default, it doesn't format the decimals `.00` Must be set to true, to format if needed.

```
NumberToWords::cents(true);
```

### Value

[](#value)

- Takes one param as `int | float | string`
    - If numbers is larger than a trillion `1_000_000_000_000`, then the value must be passed as a string.

```
NumberToWords::value(1290);
```

### toText

[](#totext)

- Convert number to readable words
    - Below, we're using the function helper method

```
NumberToWords()
    ->iso('TUR')
    ->value('120.953')
    ->cents(true)
    ->toText();

// Output: One hundred and twenty lira, nine hundred and fifty-three kuruş
```

### toNumber

[](#tonumber)

- Convert words to number
    - comma `, ` is used to seperate decimals in words

```
use Tamedevelopers\Support\NumberToWords;

NumberToWords::value('twelve million three hundred thousand, six hundred and ninety-eight')
        ->cents(true)
        ->toNumber()

// Output: 12300000.698
```

Tame
----

[](#tame)

- The Core Class of Components
    - It's helper class can be called, using -- `Tame()`

```
use Tamedevelopers\Support\Tame;
```

### byteToUnit

[](#bytetounit)

- Accepts 5 param. first param alone is needed
    - All other params are \[optional\]

ParamsDescriptionbytesThe size in bytes to be convertedformatWhether to preserve case (default: lowercase)gbCustom label for GB (default: 'GB')mbCustom label for MB (default: 'MB')kbCustom label for KB (default: 'KB')```
Tame()->byteToUnit(6880);

// Output: 7kb
```

### unitToByte

[](#unittobyte)

```
Tame()->unitToByte('24mb');

// Output: 25165824
```

### fileTime

[](#filetime)

- Returns last edited time of the file as an - `int|false`

```
Tame()->fileTime(base_path('filepath.php'));
```

### exists

[](#exists)

- Checks if a file exists and is not a directory - `bool`

```
Tame()->exists(base_path('filepath.php'));
// Output: true or false
```

### unlink

[](#unlink)

- Deletes a file from the server if it exists and does not match the restricted file name - `void`
    - \[optional\] second param &lt;filename.extension&gt;

```
Tame()->unlink(base_path('path/to/directory/avatar.png'), 'default.png');
```

### mask

[](#mask)

- Masks characters in a string based on position and length, with support for emails and custom masking characters.

ParamsDescription`$str`The string to be masked.`$length`The number of visible characters. Default is 4.`$position`The position to apply the mask: `'left'`, `'center'`, or `'right'` (default is `'right'`).`$mask`The character used for masking (default is `*`).#### Example:

[](#example)

```
Tame()->mask('example@email.com', 4, 'left');
// Output: "exam***@email.com"

Tame()->mask('example@email.com', 4, 'right');
// Output: "e***mple@email.com"

Tame()->mask('shortstring', 4, 'center');
// Output: "sh*******ng"
```

### imageToBase64

[](#imagetobase64)

- Converts an image file to its Base64 representation. Supports local files and direct URLs - `null|string`

```
Tame()->imageToBase64(base_path('path/to/image.jpg'));
// Output: "data:image/jpg;base64,..." (Base64 string for the image)

Tame()->imageToBase64('https://example.com/image.png', true);
// Output: "data:image/png;base64,..." (Base64 string for the URL image)
```

### platformIcon

[](#platformicon)

- Returns the path to the SVG icon for the specified platform or operating system.

ParamsDescription`$platform`Platform name `windows | linux | android | mobile | phone | unknown | mac | macintosh | ios | iphone | c | os x``$os_name`OS name `'macos'`, `'os x'`, `'ios'`#### Example

[](#example-1)

```
$platform = Tame()->platformIcon('windows');
// Output: /path/to/icons/platform/windows.svg

include $platform;
```

### paymentIcon

[](#paymenticon)

- Retrieves the path to the SVG icon for a specified payment method.

ParamsDescription`$payment``add-money | alipay | bank | cc | credit-card | discover | faster-pay | groupbuy | maestro | mastercard | pay | payme | payment-card | payment-wallet | paypal | stripe-circle | tripe-sqaure | stripe | visa`#### Example

[](#example-2)

```
$payment =  Tame()->paymentIcon('paypal');
// Output: /path/to/icons/payment/paypal.svg

include $payment;
```

### calPercentageBetweenNumbers

[](#calpercentagebetweennumbers)

- Calculates the percentage relationship between two numbers as an - `int`

```
Tame()->calPercentageBetweenNumbers(100, 80);
```

### formatNumberToNearestThousand

[](#formatnumbertonearestthousand)

- Formats a number to its nearest thousand, million, billion, or higher as a - `string|float|int`

```
Tame()->formatNumberToNearestThousand(1500000);
// Output: "1.5m"
```

Str
---

[](#str)

- The Core Class For String Manipulations
    - It's helper class can be called, using -- `TameStr()`

### Str Usage

[](#str-usage)

```
use Tamedevelopers\Support\Str;

// Replace first/last occurrence
Str::replaceFirst('foo', 'bar', 'foofoo');        // 'barfoo'
Str::replaceLast('foo', 'bar', 'foofoo');         // 'foobar'

// Word limiting & ASCII
Str::words('The quick brown fox jumps', 3);       // 'The quick brown...'
Str::ascii('Jürgen');                              // 'Jurgen'

// Padding
Str::padLeft('7', 3, '0');                         // '007'
Str::padRight('7', 3, '0');                        // '700'

// Pattern matching
Str::is('user/*', 'user/42');                      // true
Str::contains('brown', 'The quick brown fox');     // true

// Case/format helpers
Str::snake('Hello World');                         // 'hello_world'
Str::camel('hello world');                         // 'helloWorld'
Str::kebab('Hello World');                         // 'hello-world'
Str::title('hello world');                         // 'Hello World'
Str::studly('hello world');                        // 'HelloWorld'
Str::slug('Hello World!');                         // 'hello-world'
Str::slugify('À bientôt');                         // 'a-bientot'

// Slicing
Str::before('user:42', ':');                       // 'user'
Str::after('user:42', ':');                        // '42'
Str::between('a[core]z', '[', ']');                // 'core'

// Transformations
Str::reverse('abc');                               // 'cba'
Str::truncate('lorem ipsum', 5);                   // 'lo...'

// Randoms
Str::random(8);                                    // 'a1B9...'
Str::uuid();                                       // 'xxxxxxxx-xxxx-4xxx-...'
Str::randomWords(3);                               // 'lor em ip'

// Arrays
Str::exceptArray(['a'=>1,'b'=>2], 'a');            // ['b'=>2]
Str::renameArrayKeys([['id'=>1]], 'id', 'user_id');// [['user_id'=>1]]
Str::forgetArrayKeys(['a'=>1,'b'=>2], 'a');        // ['b'=>2]
Str::bindings(['where'=>[1,2], 'join'=>[3]]);      // [1,2,3]
Str::flattenValue([[1,2],[3]]);                    // [1,2,3]
Str::convertArrayCase(['Name'=>['Age'=>1]], 'lower', 'upper'); // ['name'=>['age'=>1]]

// Security/text helpers
Str::phone('+1 (555) 123-4567');                   // '+15551234567'
Str::mask('1234567890', 4, 'right');               // '******7890'
Str::html('&lt;b&gt;Hi&lt;/b&gt;');                  // 'Hi'
Str::text('Hi');                            // 'Hi'
Str::shorten('Long sentence here', 10);            // 'Long sente...'
Str::encrypt('secret');                            // encrypted
Str::decrypt('...');                               // original
```

TextSanitizer
-------------

[](#textsanitizer)

- The Core Class For String Sanitizer
    - It's helper class can be called, using -- `TameSanitizer()`

### Sanitizer Usage

[](#sanitizer-usage)

```
use Tamedevelopers\Support\TextSanitizer;

$text = "My number is 0812300089 and another is zero eight one two three four five six seven.
Visit https://x.com google.com or mail me at test@mail.com +23400000209
I love #coding with @friends. I also have two cats. 11092092-3";

$text2 = "I'm a beautiful zero nine zero and sweet in seven five seven eight available from ";
$text3 = "Reach me on zero eight one double two 555 nine or 0812220000";
$text4 = "Visit https://x.com google.com or mail me at test@mail.com @username.com. +23400";

$sanitizer->phoneInt($text);        //
$sanitizer->phoneWords($text2);     // I'm a beautiful [phone] available from
$sanitizer->phoneWords($text3);     // Reach me on [phone]
$sanitizer->url($text4);            // Visit [url] [url] or mail me at test@mail.com @username.com. +23400
$sanitizer->email($text4);          // Visit https://x.com google.com or mail me at [email] @username.com. +23400
$sanitizer->mention($text4);        // Visit https://x.com google.com or mail me at test@mail.com [username]. +23400
$sanitizer->findPhoneWords($text);  // Collect all numbers both in words as return as int in array
// array [
//   0 => "0812300089"
//   1 => "081234567"
//   2 => "23400000209"
//   3 => "2110920923"
// ]

$sanitizer->sanitize($text);        // sanitize all in a go!
// My number is [phone] and another is [phone].
// Visit [url] [url] or mail me at [email]. +[phone]
// I love [hastag] with [mention]. I also have two cats. [phone]-3

// sanitize(
//     string $text,
//     array $rules = [
//         'phoneInt' => '[phone]',
//         'phoneWords' => '[phone]',
//         'url' => '[url]',
//         'email' => '[email]',
//         'mention' => '[mention]',
//         'hastag' => '[hastag]',
//     ]
// );
```

Utility
-------

[](#utility)

- The Core Class For Email and String manipulations analysiss
    - It's helper class can be called, using -- `TameUtility()`

### Utility Usage

[](#utility-usage)

```
use Tamedevelopers\Support\Utility;

$text = "
The Christ the Redeemer Sanctuary, located in the heart of Rio de Janeiro, is the world’s
first open-air sanctuary, offering a sacred space welcoming people of all cultures,
beliefs, and backgrounds.";

$email = "maxwell+example@xd.org";
$email2 = "maxwell.example@gmail.com";
$email3 = "example+maxwell@icloud.com";

$util = Utility::text($text);

$util->readingTime();                   // 10 seconds
$util->wordCount();                     // 32
$util->charCount();                     // 207
$util->sentenceCount();                 // 1
$util->reverse();                       // used to reverse the text words
Utility::text('This is a new text')->readingTime(); // 2 seconds
Utility::text("A man, a plan, a canal: Panama")->isPalindrome(); //true

$util->maskEmail($email);               // *********xample@xd.org
Utility::normalizeEmail($email);        // maxwell+example@xd.org
Utility::normalizeEmail($email2);       // maxwell.example@gmail.com
Utility::normalizeEmail($email3);       // example@icloud.com
Utility::isGmail($email2);              // true
Utility::validateEmail($email);         // true
```

Country
-------

[](#country)

- Country data and helpers
    - Class: `Tamedevelopers\Support\Country`
    - It's helper class can be called, using -- `TameCountry()`

### Country Usage

[](#country-usage)

- ISO codes and flags

```
use Tamedevelopers\Support\Country;

Country::getCountryIso3('name');
Country::getCountryIso2('name');
Country::getCountryFlagIso3('name');
Country::getCountryFlagIso2('name');
```

- Months, Weeks, Time Zones, Captcha Locale

```
Country::getMonths('short');
Country::getWeeks('mon');
Country::getTimeZone('Europe/London');
Country::getCaptchaLocale('en');
```

File
----

[](#file)

- The Core File utilities (read, write, copy, move, info).
    - Class: `Tamedevelopers\Support\Capsule\File`

### File Usage

[](#file-usage)

```
use Tamedevelopers\Support\Capsule\File;

// Create directory
File::makeDirectory(storage_path('logs'));

// Write & read
File::put(storage_path('logs/app.log'), 'Hello');
$content = File::get(storage_path('logs/app.log')); // 'Hello'

// Info
File::exists(storage_path('logs/app.log')); // true
File::size(storage_path('logs/app.log')); // int bytes
File::extension(storage_path('logs/app.log')); // 'log'
File::lastModified(storage_path('logs/app.log')); // timestamp

// Move/Copy/Delete
File::copy(storage_path('logs/app.log'), storage_path('logs/app_copy.log'));
File::move(storage_path('logs/app_copy.log'), storage_path('logs/app_moved.log'));
File::delete(storage_path('logs/app_moved.log'));

// List files
$files = File::files(storage_path('logs')); // array of SplFileInfo
```

Collection
----------

[](#collection)

- Lightweight collection utilities.
    - Class: `Tamedevelopers\Support\Collections\Collection`
    - It's helper class can be called, using -- `TameCollect() | tcollect()`

### Collection Usage

[](#collection-usage)

```
use Tamedevelopers\Support\Collections\Collection;

$users = new Collection([
    ['id' => 1, 'name' => 'Ada'],
    ['id' => 2, 'name' => 'Ben'],
    ['id' => 3, 'name' => 'Cee'],
]);

$users->isEmpty();       // false
$users->count();         // 3
$users->keys()->all();   // [0,1,2]
$users->values()->all(); // same as original but reindexed

// Keep only specific keys from an associative array
$profile = new Collection(['id'=>1,'name'=>'Ada','role'=>'admin']);
$profile->only('id', 'name')->all();     // ['id'=>1,'name'=>'Ada']
$profile->except('role')->all();         // ['id'=>1,'name'=>'Ada']

// Filtering
$even = (new Collection([1,2,3,4]))->filter(fn($v) => $v % 2 === 0)->all(); // [2,4]

// Merge/Chunk/Reverse
(new Collection([1,2]))->merge([3,4])->all(); // [1,2,3,4]
(new Collection(range(1,6)))->chunk(2)->all(); // [[1,2],[3,4],[5,6]]
(new Collection([1,2,3]))->reverse()->all(); // [3,2,1]
```

Mail
----

[](#mail)

- The Core Class/Wrapper For `PHPMailer`
    - It's helper class can be called, using -- `TameMail()`
    - driver method now supports sending via `HTTP API Request`

```
Tamedevelopers\Support\Mail

Mail::to('email@example.com')
        ->subject('subject')
        ->body('Hello Body')
        ->send();
```

### config

[](#config)

- Optional Configuration if not using `.env` to set Mailer
    - If using `api driver` and the `api_url\|MAIL_API_URL` is not set. The system will automatically use their default api url path

```
$mailer = Mail::config([
    'driver' => 'api', //api|mail|smtp
    'provider' => 'brevo',
    'host' => 'sandbox.smtp.mailtrap.io',
    'port' => 587,
    'username' => '',
    'password' => '',
    'encryption' => 'ssl',
    'from_email' => 'noreply@mailtrap.io',
    'from_name' => 'Email Name',
    'api_url' => 'https://api.zeptomail.com/v1.1/email',
    'api_token' => 'api_token_or_key',
    'api_secret' => 'api_secret',
    'api_region' => 'api_region', //for amazon-ses
]);
```

- or -- `.env`

```
MAIL_MAILER=smtp
MAIL_HOST=smtp.zeptomail.com
MAIL_PORT=587
MAIL_USERNAME=noreply@example.com
MAIL_PASSWORD=""
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS="noreply@example.com"
MAIL_FROM_NAME="Email Name"
MAIL_DRIVER=""
MAIL_PROVIDER=""
MAIL_API_URL=""
MAIL_API_TOKEN=""
MAIL_API_SECRET=""
MAIL_API_REGION=""
```

### to

[](#to)

- Accepts multiple emails as `array|string`
    - All other methods should be called after you've called the `->to() method`As the method returned a new instance of class

```
Mail::to('email@example.com')

Mail::to(['email@example.com', 'email2@example.com'])

Mail::to('email@example.com', 'email2@example.com', 'email3@example.com')

Mail::to('email@example.com')->driver('api')
```

### from

[](#from)

- Accepts associative `array` and only the email key is required by default.
    - Good for immediate testing and directly setting/changing the from email data

```
Mail::to('email@example.com')
    ->from(['email' => 'example@example.com', 'name' => 'Mywebsite'])
```

### driver

[](#driver)

- Accepts mandatory `string` Default is: `smtp`
    - Supported Values `smtp|mail|api`

```
Mail::to('email@example.com')->driver('api')
```

### provider

[](#provider)

- Accepts mandatory `string` Default is: `zeptomail`

Drivers nameDescriptionzeptomail100% supported and working [ZeptoMail](https://zeptomail.zoho.com/)sendgrid100% supported and working [Sendgrid](https://login.sendgrid.com/)postmark100% supported and working [Postmark](https://postmarkapp.com/)aws100% supported and working but requires `AWS SDK - composer require aws/aws-sdk-php` and AWS-SES configurationmailchimp100% supported and working [Mailchimp](https://mailchimp.com/)elastic100% supported and working [Elastic Email](https://elasticemail.com)brevo100% supported and working [Brevo Email](https://login.brevo.com/)mailjet50% `Undergoing Development`socketlabs50% `Undergoing Development` [SocketLabs](https://www.socketlabs.com/)mailgun0% `Undergoing Development````
Mail::to('email@example.com')->driver('api')->provider('sendgrid')
```

### subject

[](#subject)

- Accepts mandatory `string`

```
Mail::subject('subject');
```

### body

[](#body)

- Accepts mandatory `string`

```
Mail::subject('body');
```

### replyTo

[](#replyto)

- Accepts two param as `string` (first is email and last is name) mandatory param `email`
    - Attaching a file and using replyTo in most cases, will send your email to SPAM/JUNK by email client

```
Mail::replyTo('info@example.com', 'Mathew');
```

### attach

[](#attach)

- Accepts multiple complex data as attachment as `array|string`

```
Mail::attach(public_path("image.png"), 'New File Name')

Mail::attach(['path' => public_path("image.png"), 'as' => 'New name'])

Mail::attach([
    ['path' => public_path("image.png"), 'as' => 'New name'],
    ['path' => public_path("image2.zip"), 'as' => 'New name2'],
    ['path' => public_path("image3.jpeng"), 'as' => 'New name2'],
])
```

### send

[](#send)

- Accepts \[optional\] closure/function

```
Mail::to('email@example.com')->send();

Mail::to('email@example.com')->send(function($reponse){

    // $reponse
});
```

### flush

[](#flush)

- Accepts mandatory `bool` Default value is false
    - Clear buffers and send email in the background without waiting (But only to be used when using an API/Submitting via Ajax/Fetch or similar method of form submission)

```
Mail::to('email@example.com')
    ->body('Body Text')
    ->flush(true)
    ->send();
```

Zip
---

[](#zip)

- Takes two param as `string`
    - \[sourcePath\] path to zip-directory
    - \[destination\] path to save zip file

```
TameZip()->zip('app/Http', 'app.zip')
```

### Unzip

[](#unzip)

- Takes two param as `string`
    - \[sourcePath\] path of zip-file
    - \[destination\] path to unzip-directory

```
TameZip()->unzip('newData.zip', base_path('public/zip'))
```

### Zip Download

[](#zip-download)

- Takes two param as `string | boolean`
    - \[fileName\] path of zip-file
    - \[unlink\] Default is `true` unlinks file after download

```
TameZip()->download('newData.zip')
```

PDF
---

[](#pdf)

- Require package to be installed - `composer require dompdf/dompdf`
    - It's helper class can be called, using -- `TamePDF()`

optionsDescriptioncontent `string`HTML Contentpaper\_size `string`Default is `A4` --- `letter | legal`paper\_type `string`Default is `portrait` --- `landscape`destination `string`Full path to where file has to be save `public_path(invoice/file.pdf)````
By default it saves the pdf generated by timename to your project root [dir] |

```

| output `string` | Default is `view` --- `save \| download` | | isRemoteEnabled `bool` | Default is `false` --- `true` If the content of html contains file/image link | | title `string` | If the html content of PDF has no title, file name will automatically become the title | | delete `bool` | Default is `true` --- `false` If output is `view` you can choose to delete file after preview |

### PDF Usage

[](#pdf-usage)

```
Tamedevelopers\Support\PDF

$generate = strtotime('now') . '.pdf';

PDF::create([
    'content'     => 'Hello World!',
    'destination' => public_path("invoice/{$generate}"),
    'output'      => 'view',
]);
```

### Read PDF

[](#read-pdf)

- Takes one param as `string`
    - \[path\] absolute path to PDF file

```
TamePDF()->read('invoice100.pdf')

// This will read the PDF to the browser
```

Time
----

[](#time)

- Class: `\Tamedevelopers\Support\Time`
    - It's helper class can be called, using -- `TameTime()`

### Time Usage

[](#time-usage)

- Get time date from class

function nameDescription`sec() | getSec()`Get seconds from time`min() | getMin()`Get minutes`hour() | getHour()`Get hour`day() | getDay()`Get days`week() | getWeek()`Get weeks`month() | getMonth()`Get months`year() | getYear()`Get years`time() | getTime()`Get time as int```
$time = new Time('now', 'Africa/Lagos');

[
    $time4->time(),
    $time4->sec(),
    $time4->min(),
    $time4->hour(),
    $time4->day(),
    $time4->week(),
    $time4->month(),
    $time4->year(),
]
```

### now

[](#now)

- Returns the Time Object with current timestamp of `now`

```
$time->now()->format()
```

### date

[](#date)

- Accepts one param as (time) `int|string`

```
$time->date("first day of this month")->toDateTimeString()
```

### today

[](#today)

- Thesame as `now()` with timestamp of `today`

### yesterday

[](#yesterday)

- Thesame as `now()` with timestamp of `yesterday`

```
$time->today();
$time->yesterday();
```

### createFromFormat

[](#createfromformat)

- Accepts two parameter \[format, date\]
    - only \[format\] is mandatory and returns the `string stamped formatted date`

```
$time->createFromFormat('m/d/Y h:ia', '24 Jan 2025 14:00:00');
// 01/25/2025 02:00am
```

### createFromDateString

[](#createfromdatestring)

- Accepts one parameter \[date\]

```
$time->createFromDateString('24 Jan 2025 14:00:00');
// 2025-01-24 14:00:00.000000
```

### timestamp

[](#timestamp)

- Accepts two parameter \[date, format\]
    - only \[date\] is mandatory and returns formated timestamp

```
$time->timestamp('24 Jan 2025 14:00:00');
// Output: 2025-01-24 14:00:00
```

### toJsTimer

[](#tojstimer)

- Accept one parameter as \[date\]. Returns formated javascript timestamp

```
$time->toJsTimer('24 Jan 2025 14:00:00');
$time->jsTimer('24 Jan 2025 14:00:00');
// Output: Jan 24, 2025 14:00:00
```

### format

[](#format)

- Accepts two parameter \[format, date\] (none is required by default)

```
$time4->now()->format()
// 2025-09-15 05:07:07
```

### toDateTimeString

[](#todatetimestring)

```
$time4->now()->toDateTimeString()
// 2025-09-13 22:00:00
```

### toDateString

[](#todatestring)

```
$time4->now()->toDateString()
// 2025-09-15
```

### toTimeString

[](#totimestring)

```
$time4->now()->toTimeString()
// 05:09:01
```

### toDateInt

[](#todateint)

```
$time4->now()->toDateInt()
// 1745798400
```

### diff

[](#diff)

- Takes one paramater as `mode`. Different between the given date a current time as `now`
    - Return an array if \[mode\] is not found or value of `mode set`

mode`year | month | hour | mins | sec | days | weeks````
$time->date('last year december')->diff('month');
// Output: 1
```

### diffBetween

[](#diffbetween)

- Takes three paramater as `firstDate \| lastDate \| mode`. Thesame as diff.

```
$time->diffBetween('last year december', 1737752400, 'weeks');
// Output: 4
```

### ago

[](#ago)

- `ago() or timeAgo()`, Takes one paramater as `mode`

mode`full | short | duration | time | date | date_time | time_stamp````
$time->date('today')->timeAgo('full')
// 17 hours ago

// Output:
$time->date('today')->ago()
[
    "full" => "4 hours ago"
    "short" => "4h"
    "duration" => 4
    "time" => 1737752400
    "date" => "24 Jan, 2025"
    "date_time" => "24 Jan, 2025 10:01am"
    "time_stamp" => "Jan 24, 2025 10:00:00"
]
```

### range

[](#range)

- Build date range according to value given
    - Accepts (2) params `value and format`

```
$time->range('0-10', 'D, M j')
// Output: returns class of Tamedevelopers\Support\Capsule\TimeHelper
```

#### get output

[](#get-output)

- To get the output, we need to call the TimeHelper format method
    - The format() method takes two \[optional\] param. `start, year` as boolean

```
$time->range('0-10')->format(true, true)
// Output: Thu, Jan 23 - Tue, Mar 4, 2025

$time->range('0-10')->format()
// Output: Tue, Mar 4
```

### addSeconds

[](#addseconds)

- Can be called using boht \[plural|singular\] formats. To add more dates with already existing time.

```
$time4->now()->addMonth(3)->addSeconds(2)->addDays(2)->format()
```

### subSeconds

[](#subseconds)

- Can be called using boht \[plural|singular\] formats. To subtract dates from already existing time.

```
$time4->now()->subMonth(3)->subSecond(2)->subDays(2)->format()
```

### allTimezone

[](#alltimezone)

```
Time::allTimezone();
```

### setTimeZone

[](#settimezone)

```
Time::setTimeZone('Pacific/Pago_Pago');
```

### getTimeZone

[](#gettimezone)

```
Time::getTimeZone();
```

HttpRequest
-----------

[](#httprequest)

- Http Request Helper
    - It's helper class can be called, using -- `TameRequest()|urlHelper()`
    - `urlHelper()` was older method name. We still keep for older project support.

```
use Tamedevelopers\Support\Process\HttpRequest;
use Tamedevelopers\Support\Process\Http; // same as HttpRequest

$http = TameRequest();

[
    Http::url(),
    HttpRequest::server(),
    HttpRequest::method(),
    $http->full(),
    $http->request(),
    $http->referral(),
    $http->http(),
    $http->host(),
    $http->path(),
]
```

Cookie
------

[](#cookie)

- Class: `\Tamedevelopers\Support\Cookie`
    - It's helper class can be called, using -- `TameCookie()`

### Cookie Usage

[](#cookie-usage)

function nameDescriptionset()Used to set cookieget()Used to get cookieforget()Used to expire cookieexpire()Same as `forget` methodall()Get all available cookiehas()Cookie exists### Set

[](#set)

- Takes `7 param`
    - Mandatory `$name` param as `string`
    - \[optional\] `$value` param as `string | null`
    - \[optional\] `$minutes` param as `int | string`
    - \[optional\] `$path` param as `string | null`
    - \[optional\] `$domain` param as `string | null`
    - \[optional\] `$secure` param as `bool | null`
    - \[optional\] `$httponly` param as `bool | null`

```
use Tamedevelopers\Support\Cookie;

Cookie::set('cookie_name', 'value');
// TameCookie()->set('user', '__user');
```

### Get

[](#get)

- Takes param as `string`

```
Cookie::get('cookie_name');
```

### Forget

[](#forget)

- Takes `3 param`
    - Mandatory `$name` param as `string`
    - \[optional\] `$path` param as `string | null`
    - \[optional\] `$domain` param as `string | null`

```
Cookie::forget('cookie_name');
```

### Has

[](#has)

- Takes param as `string`
    - Returns `bool`

```
if(Cookie::has('cookie_name')){
    // execute code
}
```

Hash
----

[](#hash)

### Hash Usage

[](#hash-usage)

- Password hashing and verify

```
use Tamedevelopers\Support\Hash;

bcrypt('testPassword');
// or
Hash::make('testPassword');

// $2y$10$Frh7yG3.qnGdQ9Hd8OK/y.aBWXFLiFD3IWqUjIWWodUhzIVF3DpT6
```

### hash-make

[](#hash-make)

```
Hash::make('secret');
```

### hash-check

[](#hash-check)

```
$oldPassword = "$2y$10$Frh7yG3.qnGdQ9Hd8OK/y.aBWXFLiFD3IWqUjIWWodUhzIVF3DpT6";
Hash::check('testPassword', $oldPassword);
// or native
password_verify('testPassword', $oldPassword);
```

Asset
-----

[](#asset)

- Takes a param as `string` path to asset file
    - Default \[dir\] is set to `public`
    - It's helper class can be called, using -- `tasset()`

```
use Tamedevelopers\Support\Asset;

Asset::asset('css/style.css');

// - Returns
// http://domain.com/assets/css/style.css
```

Asset Config
------------

[](#asset-config)

- Takes three param as `string`
    - It's helper class can be called, using -- `config_asset()`

paramsDescriptionbase\_pathPath to filecacheBy Default is `false`. Tell method to include cache for each filepath\_typeBy Default is `false`, which uses absolute path for all files. While `true` will use relative path```
use Tamedevelopers\Support\Asset;

Asset::config('public/storage');

// - Returns
// http://domain.com/public/storage/[asset_file]

// config_asset('public');
```

### Asset Cache

[](#asset-cache)

- By Default, `cache` is set to `false`
    - You'll see a link representation as `http://domain.com/[path_to_asset_file]?v=111111111`

```
Asset::config('storage', false);

// - Returns
// http://domain.com/storage/[asset_file]
```

- or -- `using helper method`

```
// absolute path
config_asset('storage/main.js', true);
// Output: http://domain.com/storage/main.js?v=111111111

// relative url path
config_asset('storage/style.css', true, true);
// Output: /storage/style.css?v=111111111
```

Laravel
-------

[](#laravel)

- Customer Laravel Blade Directives out of th box

### Blade Directives

[](#blade-directives)

- Uses the `config_asset()` Default path as an entry level for root-level folder

nameDescription/Usage@css`@css('css/app.css')`@js`@js('js/app.js')`@asset`@asset('images/logo.png', true, true)` - Similar to `tasset()`@svg`@svg('images/icon.svg', 'w-6 h-6 text-gray-500')` - Takes path and custom class to be attached to the svg```
// if you've define root access inside the public folder

config_asset(
    base_path: '/', // staring from project root[no default folder]
    cache: true, // ability to invalidate and cache files
);
```

- `then`

```

    @js('public/assets/ckeditor5/build/ckeditor.js');
    @svg('resources/svg/icon.svg');

```

View
----

[](#view)

### View Usage

[](#view-usage)

- Basic usage with layout and sections

```
use Tamedevelopers\Support\View;

// Using a child view that extends a layout
$view = new View('tests.layout.home2', [
    'title' => 'Homepage',
]);

echo $view->render();
```

- Rendering multiple times safely (same instance)

```
$view = new View('tests.layout.home2', [
    'title' => 'Homepage',
]);

// First render
echo $view->render();

// Second render (fresh render, no duplicated sections)
echo $view->render();
```

- Render and capture as a string

```
$html = (new View('tests.layout.home2', ['title' => 'Homepage']))->render();
```

### View Support

[](#view-support)

- Supported extensions for views \[only resolves filename\]
    - Similar Laravel blade syntax usage

```
$extensions = [
    '.php',        // Generic / CodeIgniter / CakePHP 4+
    '.blade.php',  // Laravel
    '.twig',       // Symfony/Twig generic
    '.html.twig',  // Symfony typical
];
```

Samples

```
@extends('layout.partials.app')

@section('content')
    Welcome to the Homepage!
@endsection

@include('layout.partials.footer', ['year' => 2025])
@yield('content')

@foreach($condition as $value)
@endforeach

@if($condition)
    @else
@endif
```

### View Helper

[](#view-helper)

- It's helper class can be called, using -- `tview()`

```
// set base folder for views
// [optional], but when set - this will be the default path to look for view files.
tview()->base('tests');

// Create a view instance via helper and render
$view = tview('layout.home2', ['title' => 'Homepage']);
echo $view->render();

// One-liner (render via static call)
use Tamedevelopers\Support\View;
echo View::render('layout.home2', ['title' => 'Homepage']);
```

Env
---

[](#env)

- By default it use the default root as `.env` path, so mandatory to install vendor in root directory.

### Env Create

[](#env-create)

- To create an environment `.env` file. Create or ignore if exists

```
use Tamedevelopers\Support\Env;

Env::createOrIgnore()
```

### Env Load

[](#env-load)

- To load the environment `.env` file
    - Takes optional param as `string` $path

```
use Tamedevelopers\Support\Env;

Env::load('path_to_env_folder')

// or
// Just as the name says. It'll load the `.env` file or fail with status code of 404. An error
Env::loadOrFail('path_to_env_folder')
```

### Env Update

[](#env-update)

- Returns `true|false`. Used to update env variables
    - It's helper class can be called, using -- `env_update()`

ParamsDescriptionkeyENV keyvalueENV valuequote`true | false` - Default is true (Allow quotes within value)space`true | false` - Default is false (Allow space between key and value)```
use Tamedevelopers\Support\Env;

Env::updateENV('DB_PASSWORD', 'newPassword');
env_update('DB_CHARSET', 'utf8', false);
```

Server
------

[](#server)

- Return instance of `Server`
    - It's helper class can be called, using -- `server()`

### Get Servers

[](#get-servers)

- Returns assoc arrays of Server
    - `server\|domain`

```
use Tamedevelopers\Support\Server;

Server::getServers();
// server()->getServers('domain');
```

### Create Custom Config

[](#create-custom-config)

- With this helper you can be able to create your own custom config by extending the Default Config Method
    - When using this model, make sure every of your php file returns an associative array for the key to work

ParamsDescriptionkeyFile array keydefaultDefault value if no data is found from the keyfolderFolder to search from and Default folder is `config````
use Tamedevelopers\Support\Server;

Server::config('tests.lang.email', [], 'tests');
```

- Create our own config to extends the default

```
/**
 * Custom Language Handler
 *
 * @param  mixed $key
 * @return mixed
 */
function __lang($key){

    // since the config only takes the filename follow by dot(.) and keyname
    // then we can manually include additional folder-name followed by / to indicate that it's a folder
    // then message.key_name
    // To make this Laravel kind of language, we can add the default value to be returned as the key
    // Do not forget that it starts from your root base directory, as the Package already has your root path

    return Server()->config("en/message.{$key}", "message.{$key}", 'lang');
}

--- Structure of folder example
--- (d) for directory and (f) for file

Base/
├── Lang/
│   ├── en/
|   |   ────── message.php (File)
|   |   ────── error.php (File)
|   |
│   ├── tr/
|   |   ────── message.php (File)
|   |   ────── error.php (File)
│   └── ...
└── ...
```

- or -- `using helpers`

```
server()->config("en/message.{$key}", "message.{$key}", 'Lang');

server()->config("app.name");
```

Manager
-------

[](#manager)

### Key Management

[](#key-management)

- The package enforces a valid application key in `.env` as `APP_KEY`.
- If `APP_KEY` is missing, invalid, or manually altered, the application will return HTTP 500 until a new key is generated via the API below.

```
use Tamedevelopers\Support\Capsule\Manager;

// Generate and persist a new key to .env and the fingerprint store
Manager::regenerate();

// Or ensure env is booted then enforce key (called internally)
Manager::startEnvIFNotStarted();
```

- Valid key format is Laravel-style: `base64:` followed by base64 of 32 random bytes.

### Helper tmanager

[](#helper-tmanager)

- You can use the helper for convenience:

```
// Generate and persist a new key
tmanager()->regenerate();

// Optionally start env and enforce key
tmanager()->startEnvIFNotStarted();
```

Autoload Register
-----------------

[](#autoload-register)

- Takes a `string|array` as parameter
    - Register one or more folders containing your PHP files
    - Automatically loads `Files|Classes` in the folder and sub-folders

```
use Tamedevelopers\Support\AutoloadRegister;

// Single folder
AutoloadRegister::load('folder');

// Multiple folders
AutoloadRegister::load(['folder', 'folder2']);

// Or use the helper
autoload_register('folder');
autoload_register(['folder', 'folder2']);
```

Helpers Functions
-----------------

[](#helpers-functions)

function nameDescriptionenv()env method `To get environment variable`server()Return instance of `(new Server)` classto\_array()`array` Convert value to arrayto\_object()`object` Convert value to objectto\_json()`string` Convert value to jsonError Dump
----------

[](#error-dump)

functionDescriptiondumpDump DataddDump and DieUseful Links
------------

[](#useful-links)

- @author Fredrick Peterson (Tame Developers)
- If you love this PHP Library, you can [Buy Tame Developers a coffee](https://www.buymeacoffee.com/tamedevelopers)

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance89

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~10 days

Total

92

Last Release

61d ago

Major Versions

1.0.9 → 2.0.02023-10-07

2.0.9 → 3.0.12023-11-08

3.0.14 → 4.02024-07-18

4.0.9 → 5.02025-09-01

### Community

Maintainers

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

---

Top Contributors

[![tamedevelopers](https://avatars.githubusercontent.com/u/52910237?v=4)](https://github.com/tamedevelopers "tamedevelopers (284 commits)")

---

Tags

composer-pluginphpphp-library

### Embed Badge

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

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M17.0k](/packages/laravel-framework)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, and coding agent control

310107.9k1](/packages/cognesy-instructor-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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