Download the PHP package free3_5man/laravel-macros without Composer

On this page you can find all versions of the php package free3_5man/laravel-macros. 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 laravel-macros

A supplement of Laravel macros and helpers

Test Status

This repository contains some useful collection macros and helper functions.

Installation

You can pull in the package via composer:

The package will automatically register itself.

Macros

helpers

Collection

append

Same with push, is a pair of prepend.

camelCaseKeys

Creates a new array from the specified assoc array, where all the keys are in camel-case.

dig

Returns the target value in a nested JSON object, based on the given key.

equals

Checks if the collection is equal to the given value.

ifAll

Returns true if the fallback function returns true for all elements in a collection,false otherwise.

ifAny

Returns true if the fallback function returns true for at least one element in a collection, false otherwise.

indexOfAll

Returns all indices of value in the array. If value never occurs, returns [].

initial

Returns all the elements of an array except the last one.

kebabCaseKeys

Creates a new array from the specified assoc array, where all the keys are in kebab-case.

limit

An alias of take.

lowerCaseKeys

Creates a new array from the specified assoc array, where all the keys are in camel-case.

mapExcept

First do high-order map, then except keys for each item.

mapKeys

First do high-order map, then only keys for each item.

mapOnly

First do high-order map, then only keys for each item.

nest

Given a flat array of objects linked to one another, it will nest them recursively.

offset

An alias of skip.

snakeCaseKeys

Creates a new array from the specified assoc array, where all the keys are in snake-case.

sortKeysByKeysRanking

Sort the collection by the keys ranking.

tail

Returns all the elements of an array except the first one.

toCSV

Converts a 2D array to a comma-separated values (CSV) string.

transformKeys

Transform only keys, values unchanged.

whereLike

Filter with regex.

whereNotLike

Reject with regex.

zipWithKeys

Given an array of valid property identifiers and an array of values, return an object associating the properties to the values. Similar but not same with collection method: combine.

Eloquent Collection

addAppends

Append attributes for each model in the collection.

addHidden

Make the hidden attributes for each model in the collection.

Query Builder

addSelectSub

Add a subquery as a column to the query.

filter

Filter using whereIn or where with the request input data or specified data.

filterRange

Filter using where or whereDate with the ranged request input data or specified data.

filterWhereNull

Filter using whereNull with the request input data or specified data.

overlaps

Filter overlaps with the given period.

Eloquent Builder

dumpSql

Dump sql with bindings.

enhancedPaginate

Enhance the existing paginate method with a map function and a given total number.

getFullSql

Get full sql string with bindings.

Arr

buildQuery

Build URL-encoded http query string.

dotOnly

Returns only the specified key / value pairs from a deeply nested array using "dot" notation.

expand

Expand the flattened dot key array to multi-dimensional array. Has the reverse effect with the existing method Arr::dot($array).

isAssoc

Judge a var is a assoc array.

isSub

Judge an array is subset of another array.

parseQuery

Parse the URL-encoded query string to array.

range

Initializes an array containing the numbers in the specified range where start and end are inclusive with there common difference step.

remove

Remove an element or elements from array.

repeat

Initializes and fills an array with the specified value.

toObject

Convert an assoc array to an object, else null.

Str

allWords

Converts a given string into an array of words with some pattern.

capitalize

Returns the capitalized string.

chars

Returns an array of the string’s character.

decapitalize

Returns the decapitalized string.

each

Just like collection each.

humanize

Converts an underscored, camelized, or dasherized string into a humanized one. Also removes beginning and ending whitespace.

lines

Splits a multiline string into an array of lines.

map

Just like collection map.

mask

Replaces part of string with the specified mask character.

reduce

Just like collection reduce.

repeat

Initializes and fills an string with the specified value.

reverse

Reverses the string.

swapCase

Returns a copy of the string in which all the case-based characters have had their case swapped.

Carbon

getNaturalWeeks

Get natural weeks array of this week, each item in this array has the week start date and the week end date. Assume monday is a week start while sunday is a week end.

CarbonPeriod

countWeeks

Count natural weeks in a period, just same as calculate the sundays count. Assume monday is a week start while sunday is a week end.

helpers

getDateTimeString

Get the specified formatted datetime string of a variable.

getTimestamp

Get the timestamp of a variable.

formatDateTimeAssoc

Format the assoc to specified format with keys.

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-macros with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
laravel/framework Version >=5.2
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 free3_5man/laravel-macros contains the following files

Loading the files please wait ....