Looking to hire Laravel developers? Try LaraJobs

laravel-functional-php maintained by zkosta

Description
A laravel wrapper for lstrojny/functional-php
Last update
2018/04/22 20:03 (dev-master)
License
Links
Downloads
10

Comments
comments powered by Disqus

The wrapper for lstrojny/functional-php v1.0.0

Requirements

  • laravel >=5.5

Installation

composer require zkosta/laravel-functional-php 

This package supports the new package auto-discovery feature of Laravel 5.5, so if you are working on a Laravel 5.5 or greater, then your install is complete

Usage

In original packet (https://github.com/lstrojny/functional-php) each function placed its own file under Functional namespace. So you need import every function you use.

Example
use function Functional\map;

map(range(0, 100), function($v) {return $v + 1;});

i've hidden them with Laravel Facade pattern. So you'll able use as

HFunc::map(range(0, 100), function($v) {return $v + 1;});

where HFunc is new facade registered whilst installation. Of course, it is possible to use functions by original way but then you do not need this package.