New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

eelcol/laravel-helpers

Laravel helper functions.
5,484
Install
composer require eelcol/laravel-helpers
Latest Version:1.2.0
PHP:^7.3.0|^8.0
Laravel:6 – 12
License:MIT
Last Updated:Oct 21, 2026
Links: GitHub  ·  Packagist
Maintainer: eelcol

Added macro's

Uploaded file

  • Directly save an uploaded file to the cloud. A new method saveToCloud is added to Illuminate\Http\UploadedFile.

string saveToCloud(string $folder, string $disk = null)

This method returns the URL of the file. When the file is saved to a local disk, a relative path is returned in stead of a complete URL.

Helper functions:

  • safe_array(array, ...keys) Retrieve a key from the array, when you do not know for sure that $array is really an array. Can be used with multiple levels: safe_array(array, level1, level2, etc)

  • safe_in_array(val, array) Check if a value is in array, when you do not know for sure that $array is an array

  • id_in_collection(id, collection) Check if an ID is present in a Eloquent collection

  • error(msg) Present an error message

  • success(msg) Present a success message

  • display_messages() Display the messages in HTML. In Blade, use: {!! display_messages() !!}

  • display_success(msg) Directly display a message in HTML. In Blade, use: {!! display_success('text') !!}

  • display_error(msg) Directly display a message in HTML. In Blade, use: {!! display_error('text') !!}

Messages can also be added by setting a session with key 'status'. This message will be printed as a success message.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

512,508,631 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

429,221,767 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

403,217,078 4,664

Version History

Version Released PHP Laravel License
1.2.0 ^7.3.0|^8.0 ^6|^7|^8|^9|^10|^11|^12 MIT
1.1.1 ^7.3.0|^8.0 ^6|^7|^8 MIT
1.1.0 ^7.3.0 ^6|^7|^8 MIT
1.0.2 >=7.1.0 MIT
1.0.1 >=7.1.0 MIT