Download the PHP package tamedevelopers/support without Composer
On this page you can find all versions of the php package tamedevelopers/support. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download tamedevelopers/support
More information about tamedevelopers/support
Files in tamedevelopers/support
Download tamedevelopers/support
More information about tamedevelopers/support
Files in tamedevelopers/support
Vendor tamedevelopers
Package support
Short Description Support Package For PHP and PHP Frameworks
License MIT
Homepage https://github.com/tamedevelopers/support
Package support
Short Description Support Package For PHP and PHP Frameworks
License MIT
Homepage https://github.com/tamedevelopers/support
Please rate this library. Is it a good library?
Informations about the package support
Support Package
Support Package For PHP and Laravel
Documentation
- Requirements
- Installation
- All Paths
- Number to Words
- ISO
- Cents
- Value
- toText
- toNumber
- Tame
- byteToUnit
- unitToByte
- fileTime
- exists
- unlink
- mask
- imageToBase64
- emailValidator
- platformIcon
- paymentIcon
- calPercentageBetweenNumbers
- formatNumberToNearestThousand
- calculateVolumeWeight
- calculateCubicMeterWeight
- getBetweenBoxLengthAndWeightInKg
- getBetweenBoxLengthAndWeightInCMB
- Str
- Usage
- phone
- mask
- html
- text
- shorten
- random
- formatString
- formatOnlyString
- encrypt
- decrypt
- bindings
- flattenValue
- exceptArray
- replaceFirst
- replaceLast
- renameArrayKeys
- forgetArrayKeys
- changeKeyCase
- convertArrayCase
- padLeft
- padRight
- words
- ascii
- is
- snake
- camel
- kebab
- title
- studly
- slugify
- slug
- before
- after
- between
- contains
- truncate
- reverse
- count
- countOccurrences
- uuid
- randomWords
- extension
- wrap
- head
- last
- Country
- Usage
- iso3
- iso2
- flagIso3
- flagIso2
- month
- week
- zone
- captcha
- File
- Usage
- files
- makeDirectory
- exists
- get
- put
- delete
- copy
- move
- size
- lastModified
- extension
- name
- mimeType
- type
- permissions
- isReadable
- isWritable
- isDirectory
- isFile
- isFileType
- Collection
- Usage
- has
- count
- all
- isNotEmpty
- isEmpty
- isSame
- isDuplicate
- reverse
- pad
- combine
- collapse
- flatten
- zip
- merge
- only
- except
- chunk
- keys
- values
- filter
- reject
- where
- whereIn
- whereNotIn
- whereNull
- whereNotNull
- first
- firstWhere
- last
- contains
- doesntContain
- every
- some
- select
- map
- mapWithKeys
- pluck
- pluckDot
- groupBy
- search
- sort
- sortBy
- sortByMany
- sortByDesc
- sortKeys
- sortKeysDesc
- keyBy
- slice
- take
- takeUntil
- skip
- concat
- union
- toBase
- pipe
- crossJoin
- join
- unique
- each
- forget
- changeKeyCase
- reduce
- shuffle
- partition
- tap
- chunkWhile
- nth
- paginate
- zipWith
- countBy
- duplicates
- shuffleKeys
- average
- avg
- sum
- max
- min
- Mail
- config
- to
- subject
- altBody
- body
- cc
- bcc
- replyTo
- attach
- delete
- send
- flush
- obFlush
- convert
- Zip
- Unzip
- Zip Download
- PDF
- Usage
- Read PDF
- Time
- time-usage
- now
- date
- today
- yesterday
- createFromFormat
- timestamp
- toJsTimer
- diff
- diffBetween
- ago
- range
- format
- toDateTimeString
- addSeconds
- subSeconds
- addMinutes
- subMinutes
- addHours
- subHours
- addDays
- subDays
- addWeeks
- subWeeks
- addMonths
- subMonths
- addYears
- subYears
- greeting
- allTimezone
- setTimeZone
- getTimeZone
- HttpRequest
- url
- http
- host
- full
- path
- server
- request
- referral
- Cookie
- Usage
- set
- get
- forget
- expire
- all
- has
- Hash
- Usage
- make
- check
- Asset
- Asset config
- Asset Cache
- Asset config
- View
- Usage
- Support
- Helper tview
- Env
- Env Create
- Env Load
- Env Update
- Manager
- Key Management
- Helper tmanager
- Server
- Get Servers
- Create Custom Config
- Create Config Template File
- Autoload Register
- Helpers Functions
- Error Dump
- Error Status
- Useful links
Requirements
>= php 8.0+
Installation
Prior to installing support package
get the Composer dependency manager for PHP because it'll simplify installation.
All Paths
function name | Description |
---|---|
base_path() | Get absolute base directory path. Accepts a param string if given, and append to path |
directory() | Thesame as base_path() |
public_path() | Root/public path. Accepts a param string if given, and append to path |
storage_path() | Root/storage path. Accepts a param string if given, and append to path |
app_path() | Root/app path. Accepts a param string if given, and append to path |
config_path() | Root/config path. Accepts a param string if given, and append to path |
lang_path() | Root/lang path. Accepts a param string if given, and append to path |
domain() | Returns domain URI. Accepts a param string if given, and append to path |
Number to Words
- Has three chainable methods
- Can translate all the way to
vigintillion
- It's helper class can be called, using --
NumberToWords()
- Can translate all the way to
iso (country iso3) | cents | number |
---|---|---|
NGA \| GBR \| USA |
true \| false |
int\|float\|string |
If iso is given and found, it'll automatically converts the text into a currency format |
If you want the decimals to be translated to text as well. | numeric figures: 299 \| '42,982' \| 3200.98 |
Iso
- Takes param as
string
and case-insensitive
Cents
- Takes param as
boolean
. Default isfalse
- By default, it doesn't format the decimals
.00
Must be set to true, to format if needed.
- By default, it doesn't format the decimals
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.
- If numbers is larger than a trillion
toText
- Convert number to readable words
- Below, we're using the function helper method
toNumber
- Convert words to number
- comma
,
is used to seperate decimals in words
- comma
Tame
- The Core Class of Components
- It's helper class can be called, using --
Tame()
- It's helper class can be called, using --
byteToUnit
- Accepts 5 param. first param alone is needed
- All other params are [optional]
Params | Description |
---|---|
bytes | The size in bytes to be converted |
format | Whether to preserve case (default: lowercase) |
gb | Custom label for GB (default: 'GB') |
mb | Custom label for MB (default: 'MB') |
kb | Custom label for KB (default: 'KB') |
unitToByte
fileTime
- Returns last edited time of the file as an -
int|false
exists
- Checks if a file exists and is not a directory -
bool
unlink
- Deletes a file from the server if it exists and does not match the restricted file name -
void
- [optional] second param
- [optional] second param
mask
- Masks characters in a string based on position and length, with support for emails and custom masking characters.
Params | Description |
---|---|
$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:
imageToBase64
- Converts an image file to its Base64 representation. Supports local files and direct URLs -
null|string
emailValidator
- Validates an email address with optional domain and server verification -
bool
Params | Description |
---|---|
The email address to validate. | |
use_internet | By default is set to false . If true , checks the domain using DNS (checkdnsrr() and getmxrr() ) for validity. If false , skips domain validation (default: false ). |
server_verify | Verifies the mail server by checking MX records (default: false ). Only used if use_internet is true . |
platformIcon
- Returns the path to the SVG icon for the specified platform or operating system.
Params | Description |
---|---|
$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
paymentIcon
- Retrieves the path to the SVG icon for a specified payment method.
Params | Description |
---|---|
$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
calPercentageBetweenNumbers
- Calculates the percentage relationship between two numbers as an -
int
formatNumberToNearestThousand
- Formats a number to its nearest thousand, million, billion, or higher as a -
string|float|int
Str
- The Core Class For String Manipulations
- It's helper class can be called, using --
TameStr()
- It's helper class can be called, using --
Str Usage
Country
- Country data and helpers
- Class:
Tamedevelopers\Support\Country
- It's helper class can be called, using --
TameCountry()
- Class:
Country Usage
-
ISO codes and flags
- Months, Weeks, Time Zones, Captcha Locale
File
- The Core File utilities (read, write, copy, move, info).
- Class:
Tamedevelopers\Support\Capsule\File
- Class:
File Usage
Collection
- Lightweight collection utilities.
- Class:
Tamedevelopers\Support\Collections\Collection
- It's helper class can be called, using --
TameCollect() | tcollect()
- Class:
Collection Usage
- The Core Class/Wrapper For
PHPMailer
- It's helper class can be called, using --
TameMail()
- It's helper class can be called, using --
to
- Accepts multiple emails as
array|string
attach
- Accepts multiple complex data as attachment as
array|string
subject
- Accepts mandatory
string
body
- Accepts mandatory
string
send
- Accepts [optional] closure/function
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)
Zip
- Takes two param as
string
- [sourcePath] path to zip-directory
- [destination] path to save zip file
Unzip
- Takes two param as
string
- [sourcePath] path of zip-file
- [destination] path to unzip-directory
Zip Download
- Takes two param as
string | boolean
- [fileName] path of zip-file
- [unlink] Default is
true
unlinks file after download
- Require package to be installed -
composer require dompdf/dompdf
- It's helper class can be called, using --
TamePDF()
- It's helper class can be called, using --
options | Description |
---|---|
content string |
HTML Content |
paper_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
Read PDF
- Takes one param as
string
- [path] absolute path to PDF file
Time
- Class:
\Tamedevelopers\Support\Time
- It's helper class can be called, using --
TameTime()
- It's helper class can be called, using --
Time Usage
- Get time date from class
function name | Description |
---|---|
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 |
now
- Returns the Time Object with current timestamp of
now
date
- Accepts one param as (time)
int|string
today
- Thesame as
now()
with timestamp oftoday
yesterday
- Thesame as
now()
with timestamp ofyesterday
createFromFormat
- Accepts two parameter [date, format]
- only [date] is mandatory and returns the Time(object)
timestamp
- Accepts two parameter [date, format]
- only [date] is mandatory and returns formated timestamp
toJsTimer
- Accept one parameter as [date]. Returns formated javascript timestamp
diff
- Takes one paramater as
mode
. Different between the given date a current time asnow
- Return an array if [mode] is not found or value of
mode set
- Return an array if [mode] is not found or value of
mode |
---|
year \| month \| hour \| mins \| sec \| days \| weeks |
diffBetween
- Takes three paramater as
firstDate \| lastDate \| mode
. Thesame as diff.
ago
ago() or timeAgo()
, Takes one paramater asmode
mode |
---|
full \| short \| duration \| time \| date \| date_time \| time_stamp |
range
- Build date range according to value given
- Accepts (2) params
value and format
- Accepts (2) params
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
- The format() method takes two [optional] param.
addSeconds
- Can be called using boht [plural|singular] formats. To add more dates with already existing time.
subSeconds
- Can be called using boht [plural|singular] formats. To subtract dates from already existing time.
allTimezone
setTimeZone
getTimeZone
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.
- It's helper class can be called, using --
Cookie
- Class:
\Tamedevelopers\Support\Cookie
- It's helper class can be called, using --
TameCookie()
- It's helper class can be called, using --
Cookie Usage
function name | Description |
---|---|
set() | Used to set cookie |
get() | Used to get cookie |
forget() | Used to expire cookie |
expire() | Same as forget method |
all() | Get all available cookie |
has() | Cookie exists |
Set
- Takes
7 param
- Mandatory
$name
param asstring
- [optional]
$value
param asstring | null
- [optional]
$minutes
param asint | string
- [optional]
$path
param asstring | null
- [optional]
$domain
param asstring | null
- [optional]
$secure
param asbool | null
- [optional]
$httponly
param asbool | null
- Mandatory
Get
- Takes param as
string
Forget
- Takes
3 param
- Mandatory
$name
param asstring
- [optional]
$path
param asstring | null
- [optional]
$domain
param asstring | null
- Mandatory
Has
- Takes param as
string
- Returns
bool
- Returns
Hash
Hash Usage
- Password hashing and verify
hash-make
hash-check
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()
- Default [dir] is set to
Asset Config
- Takes three param as
string
- It's helper class can be called, using --
config_asset()
- It's helper class can be called, using --
params | Description |
---|---|
base_path | Path to file |
cache | By Default is false . Tell method to include cache for each file |
path_type | By Default is false , which uses absolute path for all files. While true will use relative path |
Asset Cache
-
By Default,
cache
is set tofalse
- You'll see a link representation as
http://domain.com/[path_to_asset_file]?v=111111111
- You'll see a link representation as
- or --
using helper method
View
View Usage
-
Basic usage with layout and sections
-
Rendering multiple times safely (same instance)
- Render and capture as a string
View Support
- Supported extensions for views [only resolves filename]
- Similar Laravel blade syntax usage
Samples
View Helper
- It's helper class can be called, using --
tview()
Env
- By default it use the default root as
.env
path, so mandatory to install vendor in root directory.
Env Create
- To create an environment
.env
file. Create or ignore if exists
Env Load
- To load the environment
.env
file- Takes optional param as
string
$path
- Takes optional param as
Env Update
- Returns
true|false
. Used to update env variables- It's helper class can be called, using --
env_update()
- It's helper class can be called, using --
Params | Description |
---|---|
key | ENV key |
value | ENV value |
quote | true \| false - Default is true (Allow quotes within value) |
space | true \| false - Default is false (Allow space between key and value) |
Server
- Return instance of
Server
- It's helper class can be called, using --
server()
- It's helper class can be called, using --
Get Servers
- Returns assoc arrays of Server
server\|domain
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
Params | Description |
---|---|
key | File array key |
default | Default value if no data is found from the key |
folder | Folder to search from and Default folder is config |
-
Create our own config to extends the default
- or --
using helpers
Manager
Key Management
- The package enforces a valid application key in
.env
asAPP_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. - Valid key format is Laravel-style:
base64:
followed by base64 of 32 random bytes.
Helper tmanager
- You can use the helper for convenience:
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
Helpers Functions
function name | Description |
---|---|
env() | env method To get environment variable |
server() | Return instance of (new Server) class |
to_array() | array Convert value to array |
to_object() | object Convert value to object |
to_json() | string Convert value to json |
Error Dump
function | Description |
---|---|
dump | Dump Data |
dd | Dump and Die |
Useful Links
- @author Fredrick Peterson (Tame Developers)
- If you love this PHP Library, you can Buy Tame Developers a coffee
All versions of support with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.0
ext-ctype Version *
ext-mbstring Version *
symfony/var-dumper Version *
symfony/console Version ^6.0
symfony/http-foundation Version ^6.0
cocur/slugify Version ^4.2.0
vlucas/phpdotenv Version ^5.4.1
phpmailer/phpmailer Version ^6.9
filp/whoops Version ^2.15
ezyang/htmlpurifier Version ^4.13
composer-plugin-api Version ^2.0
dompdf/dompdf Version ^3.0
ext-ctype Version *
ext-mbstring Version *
symfony/var-dumper Version *
symfony/console Version ^6.0
symfony/http-foundation Version ^6.0
cocur/slugify Version ^4.2.0
vlucas/phpdotenv Version ^5.4.1
phpmailer/phpmailer Version ^6.9
filp/whoops Version ^2.15
ezyang/htmlpurifier Version ^4.13
composer-plugin-api Version ^2.0
dompdf/dompdf Version ^3.0
The package tamedevelopers/support contains the following files
Loading the files please wait ....