Download the PHP package bnomei/kirby3-collect without Composer

On this page you can find all versions of the php package bnomei/kirby3-collect. 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 kirby3-collect

Kirby Collect

Release Downloads Build Status Coverage Status Maintainability Twitter

Adds support for Laravel collections to Kirby

Installation

Why Laravel collections?

This is a plugin for those that create web-projects in Kirby that have to manipulate lots of array data and want to refactor to collections to avoid excessive use of foreach-loops and if-clauses.

Usage

See official Laravel docs on how to use the collect-helper and the collection methods.

all, average, avg, chunk, chunkWhile, collapse, collect, combine, concat, contains, containsStrict, count, countBy, crossJoin, dd, diff, diffAssoc, diffKeys, doesntContain, dump duplicates, duplicatesStrict, each, eachSpread, every, except, filter, first, firstOrFail, firstWhere, flatMap, flatten, flip, forget, forPage, get, groupBy, has, implode, intersect, intersectByKeys, isEmpty, isNotEmpty, join, keyBy, keys, last, lazy, macro, make, map, mapInto, mapSpread, mapToGroups, mapWithKeys, max, median, merge, mergeRecursive, min, mode, nth, only, pad, partition, pipe, pipeInto, pipeThrough, pluck, pop, prepend, pull, push, put, random, range, reduce, reduceSpread, reject, replace, replaceRecursive, reverse search, shift, shuffle, sliding, skip, skipUntil, skipWhile, slice, sole, some, sort, sortBy, sortByDesc, sortDesc, sortKeys, sortKeysDesc, sortKeysUsing, splice, split, splitIn, sum, take, takeUntil, takeWhile, tap, times, toArray, toJson, transform, undot, union, unique, uniqueStrict, unless, unlessEmpty, unlessNotEmpty, unwrap, values, when, whenEmpty, whenNotEmpty, where, whereStrict, whereBetween, whereIn, whereInStrict, whereInstanceOf, whereNotBetween, whereNotIn, whereNotInStrict, whereNotNull, whereNull, wrap, zip

The methodnames in bold indicate that Kirby has a similar collection method. It also features to some additional methods.

Laravel collections from an array

You can also get a laravel collection object from any array.

Create a Laravel collection from a Kirby collection

Primitive data-types only

You can also convert all objects into primitive types using json encoding and decoding. But be warned that most of Kirby's core objects will not (yet) automatically serialize themselves.

When to use Laravel collection methods (and when not)

To achieve certain common use-cases the Laravel collections methods are a bit more explicit than Kirby's collection methods.

But keep in mind that Kirby's collection methods have been tailored to work with the core objects like Page and make some tasks very easy where using Laravel collection methods would be more tedious.

Underscore shorthand

Instead of calling the ->collect()/_() collection method evert time you can also use underscore to start with laravel collections object. But any further method calls do not need the _ prefix.

Dependencies

Disclaimer

This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.

License

MIT

It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.


All versions of kirby3-collect with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0.0
getkirby/composer-installer Version ^1.2
illuminate/collections Version ^9.12
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 bnomei/kirby3-collect contains the following files

Loading the files please wait ....