Download the PHP package tobento/service-collection without Composer

On this page you can find all versions of the php package tobento/service-collection. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package service-collection

Collection Service

The Collection Service provides fluent and convenient wrapper classes for working with arrays of data.

Table of Contents

Getting started

Add the latest version of the collection service running this command.

Requirements

Highlights

Documentation

Collection

Method Description Dot Notation Supported
add() Add an item value if it does not exist or is null. yes
all() Get all items. -
any() Check if at least one of the items exists. yes
combine() Combine item values with item keys. no
count() Counts the items. -
delete() Delete an item by key. yes
empty() Check whether collection or an item is empty. yes
except() Get all items except the keys specified. yes
filter() Filter items. -
first() Get first item passing a given truth test. -
flatten() Flatten array to single level array. -
get() Get an item value by key. yes
has() Check if an item by key exists. yes
keys() Gets the item keys. First array level only. no
last() Get last item passing a given truth test. -
map() Map over each of the items. -
merge() Merge items. no
mergeRecursive() Merge items recursive. no
only() Get only the items from the keys specified. yes
onlyPresent() Get only the items present from the keys specified. yes
replace() Replace the items. -
replaceRecursive() Replace the items recursive. -
set() Set an item value by key. yes
setAll() Set all items. no
toArray() Converts the collection into a plain PHP array. -
toJson() Converts the collection into a JSON serialized string. -
union() Same as merge, except existing items got not overwritten. -
values() Gets the item values. -

add()

Add an item value if it does not exist or is null.

all()

Get all items from the collection.

any()

Check if at least one of the items exists.

combine()

Combine item values with item keys.

count()

Counts the items.

delete()

Delete an item by key.

empty()

Check whether collection or an item is empty.

except()

Get all items except the keys specified.

filter()

Filter items.

first()

Get first item passing a given truth test.

flatten()

Flatten array to single level array.

get()

Get an item value by key.

has()

Check if an item by key exists.

keys()

Gets the item keys. First array level only.

last()

Get last item passing a given truth test.

map()

Map over each of the items.

merge()

Merge items.

mergeRecursive()

Merge items recursive.

only()

Get only the items from the keys specified.

onlyPresent()

Get only the items present from the keys specified.

replace()

Replace the items.

replaceRecursive()

Replace the items recursive.

set()

Set an item value by key.

setAll()

Set all items.

toArray()

Converts the collection into a plain PHP array.

toJson()

Converts the collection into a JSON serialized string.

union()

Same as merge, except existing items got not overwritten.

values()

Gets the item values.

Translations

Create a new Translations collection.

setAll()

Set all translations. This would overwrite all previous translations.

set()

Set translation(s) value by key.

add()

Add translation(s) value by key if it does not exist or is null.

get()

Get value for default locale:

Get value for specific locale:

Get values for current locales:

Get values for specific locales:

has()

If translation(s) by key exist.

all()

Get all translation(s).

delete()

Delete translation(s) by key.

deleteAll()

Delete all translation(s).

toArray()

toJson()

Credits

Idea and some code snippets is taken from Collections of the Laravel framework.


All versions of service-collection with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
tobento/service-support Version ^1.0
tobento/service-macro Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tobento/service-collection contains the following files

Loading the files please wait ....