Download the PHP package sebastiaanluca/laravel-helpers without Composer

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

Latest stable release Build status Total downloads Total downloads

Read my blog View my other packages and projects Follow @sebastiaanluca on Twitter Share this package on Twitter

An extensive set of Laravel framework helper functions and collection macros.

Table of contents

Requirements

How to install

Just add the package to your project using Composer and Laravel will auto-discover it:

If you want to use the collection debug macros, install the kint-php/kint package as a dev dependency:

Upgrading from 1.x

All essential generic PHP helpers have been extracted to their own sebastiaanluca/php-helpers package and some other helpers have been removed in anticipation of their own package. In effect and from now on, Laravel Helpers will only contain helpers for the Laravel framework.

See the changelog for more information.

Framework helper functions

locale

Get the active app locale or the fallback locale if it's missing or not set.

is_guest

Determine if the current user is a guest.

The opposite of is_logged_in.

is_logged_in

Determine if the current user is authenticated.

The opposite of is_guest.

user

Get the currently authenticated user (if there is one).

When logged in, returns your user model or object that implements \Illuminate\Contracts\Auth\Authenticatable.

me

Get the currently authenticated user (if there is one).

When logged in, returns your user model or object that implements \Illuminate\Contracts\Auth\Authenticatable.

An alternative for user.

Collection macros

carbonize

Create Carbon instances from items in a collection.

between

Reduce each collection item to the value found between a given start and end string.

The second parameter is optional and falls back to the start string if null.

transformKeys

Perform an operation on the collection's keys.

The callable operation can either be a globally available method or a closure.

transpose

Transpose (flip) a collection matrix (array of arrays) so its columns become rows and its rows become columns.

transposeWithKeys

Flip a collection of rows and values per column so its columns become rows and its rows become columns.

Before:

id name
A 1 James
B 2 Joe
C 3 Jonas

After:

A B C
id 1 2 3
name James Joe Jonas

How to use:

You can also pass some row header names if you don't want them to be automatically guessed. You'd then call the macro with transposeWithKeys(['myID', 'row2']) and the resulting rows would be myID and row2 instead of id and name respectively.

d

Display structured debug information on the collection using Kint. Can be called multiple times during a collection's method chain and outputs debug information at each point of use. Continues script execution afterwards.

Explicitly requires the kint-php/kint package.

ddd

Display structured debug information on the collection using Kint. Halts script execution afterwards, so it can only be called once during a collection's method chain.

Explicitly requires the kint-php/kint package.

License

This package operates under the MIT License (MIT). Please see LICENSE for more information.

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

Contributing

Please see CODE OF CONDUCT for details.

Security

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

Credits

About

My name is Sebastiaan and I'm a freelance Laravel developer specializing in building custom Laravel applications. Check out my portfolio for more information, my blog for the latest tips and tricks, and my other packages to kick-start your next project.

Have a project that could use some guidance? Send me an e-mail at [email protected]!


All versions of laravel-helpers with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3
laravel/framework Version ^7.0|^8.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 sebastiaanluca/laravel-helpers contains the following files

Loading the files please wait ....