Looking to hire Laravel developers? Try LaraJobs

laravel-helpers maintained by nechin

Description
Added new helper methods to a facades
Last update
2025/12/16 15:54 (dev-master)
License
Links
Downloads
1

Comments
comments powered by Disqus

nechin/laravel-helpers

Source Code

About

Laravel helpers package that extends a different facades

Installation

The preferred method of installation is via Packagist and Composer. Run the following command to install the package and add it as a requirement to your project's composer.json:

composer require nechin/laravel-helpers

Requirements

Laravel 5.4 PHP 8.0

Examples

Method fileExt for the Str facade, that return a file extension by the file path

\Illuminate\Support\Str::fileExt('path\to\file.ext'); // "ext"

Method randomParts for the Str facade, that return a string with random generated parts of string separated by the separator

\Illuminate\Support\Str::randomParts(4, 5, '+'); // "RnHxg+R9i1r+3F3P8+HJ9FT"

Method redirectList for the Route facade, that adds the ability to specify a list of a redirects

// routes/web.php
\Illuminate\Routing\Route::redirectList([
    '/from' => '/to'
]);

Method delete for the Arr facade, that delete elements by the value

$array = [1, 2, '1', 3];
\Illuminate\Support\Arr::delete($array, 1); // [2, 3]
\Illuminate\Support\Arr::delete($array, 1, true); // [2, '1', 3]

Method pullAll for the Arr facade, that getting array elements by value

$array = [1, 2, 'foo' => '1', 3];
\Illuminate\Support\Arr::pullAll($array, 1); // [0 => 1, 'foo' => 1]
\Illuminate\Support\Arr::pullAll($array, 1, true); // [0 => 1]

Method pullFirst for the Arr facade, that getting first array element by value

$array = [1, 2, 'foo' => '3', 3];
\Illuminate\Support\Arr::pullFirst($array, 3); // ['foo' => 3]
\Illuminate\Support\Arr::pullFirst($array, 3, true); // [2 => 3]

Copyright and license

The nechin/laravel-helpers library is copyright © Alexander Vitkalov and licensed for use under the MIT License (MIT). Please see LICENSE for more information.