A set of useful Laravel collection macros

Overview

A set of useful Laravel collection macros

Latest Version on Packagist Run tests Check & fix styling Total Downloads

This repository contains some useful collection macros.

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

You can pull in the package via composer:

composer require spatie/laravel-collection-macros

The package will automatically register itself.

Macros

after

Get the next item from the collection.

$collection = collect([1,2,3]);

$currentItem = 2;

$currentItem = $collection->after($currentItem); // return 3;
$collection->after($currentItem); // return null;

$currentItem = $collection->after(function($item) {
    return $item > 1;
}); // return 3;

You can also pass a second parameter to be used as a fallback.

$collection = collect([1,2,3]);

$currentItem = 3;

$collection->after($currentItem, $collection->first()); // return 1;

at

Retrieve an item at an index.

$data = new Collection([1, 2, 3]);

$data->at(0); // 1
$data->at(1); // 2
$data->at(-1); // 3

second

Retrieve item at the second index.

$data = new Collection([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

$data->second(); // 2

third

Retrieve item at the third index.

$data = new Collection([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

$data->third(); // 3

fourth

Retrieve item at the fourth index.

$data = new Collection([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

$data->fourth(); // 4

fifth

Retrieve item at the fifth index.

$data = new Collection([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

$data->fifth(); // 5

sixth

Retrieve item at the sixth index.

$data = new Collection([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

$data->sixth(); // 6

seventh

Retrieve item at the seventh index.

$data = new Collection([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

$data->seventh(); // 7

eighth

Retrieve item at the eighth index.

$data = new Collection([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

$data->eighth(); // 8

ninth

Retrieve item at the ninth index.

$data = new Collection([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

$data->ninth(); // 9

tenth

Retrieve item at the tenth index.

$data = new Collection([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);

$data->tenth(); // 10

before

Get the previous item from the collection.

$collection = collect([1,2,3]);

$currentItem = 2;

$currentItem = $collection->before($currentItem); // return 1;
$collection->before($currentItem); // return null;

$currentItem = $collection->before(function($item) {
    return $item > 2;
}); // return 2;

You can also pass a second parameter to be used as a fallback.

$collection = collect([1,2,3]);

$currentItem = 1;

$collection->before($currentItem, $collection->last()); // return 3;

catch

See Try

chunkBy

Chunks the values from a collection into groups as long the given callback is true. If the optional parameter $preserveKeys as true is passed, it will preserve the original keys.

collect(['A', 'A', 'B', 'A'])->chunkBy(function($item) {
    return $item == 'A';
}); // return Collection([['A', 'A'],['B'], ['A']])

collectBy

Get an item at a given key, and collect it.

$collection = collect([
    'foo' => [1, 2, 3],
    'bar' => [4, 5, 6],
]);

$collection->collectBy('foo'); // Collection([1, 2, 3])

You can also pass a second parameter to be used as a fallback.

$collection = collect([
    'foo' => [1, 2, 3],
    'bar' => [4, 5, 6],
]);

$collection->collectBy('baz', ['Nope']); // Collection(['Nope'])

eachCons

Get the following consecutive neighbours in a collection from a given chunk size. If the optional parameter $preserveKeys as true is passed, it will preserve the original keys.

collect([1, 2, 3, 4])->eachCons(2); // return collect([[1, 2], [2, 3], [3, 4]])

extract

Extract keys from a collection. This is very similar to only, with two key differences:

  • extract returns an array of values, not an associative array
  • If a value doesn't exist, it will fill the value with null instead of omitting it

extract is useful when using PHP 7.1 short list() syntax.

[$name, $role] = collect($user)->extract('name', 'role.name');

filterMap

Map a collection and remove falsy values in one go.

$collection = collect([1, 2, 3, 4, 5, 6])->filterMap(function ($number) {
    $quotient = $number / 3;

    return is_integer($quotient) ? $quotient : null;
});

$collection->toArray(); // returns [1, 2]

firstOrFail

Get the first item. Throws Spatie\CollectionMacros\Exceptions\CollectionItemNotFound if the item was not found.

$collection = collect([1, 2, 3, 4, 5, 6])->firstOrFail();

$collection->toArray(); // returns [1]

collect([])->firstOrFail(); // throws Spatie\CollectionMacros\Exceptions\CollectionItemNotFound

fromPairs

Transform a collection into an associative array form collection item.

$collection = collect([['a', 'b'], ['c', 'd'], ['e', 'f']])->fromPairs();

$collection->toArray(); // returns ['a' => 'b', 'c' => 'd', 'e' => 'f']

glob

Returns a collection of a glob() result.

Collection::glob('config/*.php');

groupByModel

Similar to groupBy, but groups the collection by an Eloquent model. Since the key is an object instead of an integer or string, the results are divided into separate arrays.

$posts->groupByModel('category');

// [
//     [$categoryA, [/*...$posts*/]],
//     [$categoryB, [/*...$posts*/]],
// ];

Full signature: groupByModel($callback, $preserveKeys, $modelKey, $itemsKey)

head

Retrieves first item from the collection.

$collection = collect([1,2,3]);

$collection->head(); // return 1

$collection = collect([]);

$collection->head(); // return null

ifAny

Executes the passed callable if the collection isn't empty. The entire collection will be returned.

collect()->ifAny(function(Collection $collection) { // empty collection so this won't get called
   echo 'Hello';
});

collect([1, 2, 3])->ifAny(function(Collection $collection) { // non-empty collection so this will get called
   echo 'Hello';
});

ifEmpty

Executes the passed callable if the collection is empty. The entire collection will be returned.

collect()->ifEmpty(function(Collection $collection) { // empty collection so this will called
   echo 'Hello';
});

collect([1, 2, 3])->ifEmpty(function(Collection $collection) { // non-empty collection so this won't get called
   echo 'Hello';
});

none

Checks whether a collection doesn't contain any occurrences of a given item, key-value pair, or passing truth test. The function accepts the same parameters as the contains collection method.

collect(['foo'])->none('bar'); // returns true
collect(['foo'])->none('foo'); // returns false

collect([['name' => 'foo']])->none('name', 'bar'); // returns true
collect([['name' => 'foo']])->none('name', 'foo'); // returns false

collect(['name' => 'foo'])->none(function ($key, $value) {
   return $key === 'name' && $value === 'bar';
}); // returns true

paginate

Create a LengthAwarePaginator instance for the items in the collection.

collect($posts)->paginate(5);

This paginates the contents of $posts with 5 items per page. paginate accepts quite some options, head over to the Laravel docs for an in-depth guide.

paginate(int $perPage = 15, string $pageName = 'page', int $page = null, int $total = null, array $options = [])

parallelMap

Identical to map but each item in the collection will be processed in parallel. Before using this macro you should pull in the amphp/parallel-functions package.

composer require amphp/parallel-functions

Be aware that under the hood some overhead is introduced to make the parallel processing possible. When your $callable is only a simple operation it's probably better to use map instead. Also keep in mind that parallelMap can be memory intensive.

$pageSources = collect($urls)->parallelMap(function($url) {
    return file_get_contents($url);
});

The page contents of the given $urls will be fetched at the same time. The underlying amp sets a maximum of 32 concurrent processes by default.

There is a second (optional) parameter, through which you can define a custom parallel processing pool. It looks like this:

use Amp\Parallel\Worker\DefaultPool;

$pool = new DefaultPool(8);

$pageSources = collect($urls)->parallelMap(function($url) {
    return file_get_contents($url);
}, $pool);

If you don't need to extend the worker pool, or can't be bothered creating the new pool yourself; you can use an integer the the number of workers you'd like to use. A new DefaultPool will be created for you:

$pageSources = collect($urls)->parallelMap(function($url) {
    return file_get_contents($url);
}, 8);

This helps to reduce the memory overhead, as the default worker pool limit is 32 (as defined in amphp/parallel). Using fewer worker threads can significantly reduce memory and processing overhead, in many cases. Benchmark and customise the worker thread limit to suit your particular use-case.

pluckToArray

Returns array of values of a given key.

$collection = collect([
    ['a' => 1, 'b' => 10],
    ['a' => 2, 'b' => 20],
    ['a' => 3, 'b' => 30]
]);

$collection->pluckToArray('a'); // returns [1, 2, 3]

prioritize

Move elements to the start of the collection.

$collection = collect([
    ['id' => 1],
    ['id' => 2],
    ['id' => 3],
]);

$collection
   ->prioritize(function(array $item) {
      return $item['id'] === 2;
   })
   ->pluck('id')
   ->toArray(); // returns [2, 1, 3]

rotate

Rotate the items in the collection with given offset

$collection = collect([1, 2, 3, 4, 5, 6]);

$rotate = $collection->rotate(1);

$rotate->toArray();

// [2, 3, 4, 5, 6, 1]

sectionBy

Splits a collection into sections grouped by a given key. Similar to groupBy but respects the order of the items in the collection and reuses existing keys.

$collection = collect([
    ['name' => 'Lesson 1', 'module' => 'Basics'],
    ['name' => 'Lesson 2', 'module' => 'Basics'],
    ['name' => 'Lesson 3', 'module' => 'Advanced'],
    ['name' => 'Lesson 4', 'module' => 'Advanced'],
    ['name' => 'Lesson 5', 'module' => 'Basics'],
]);

$collection->sectionBy('module');

// [
//     ['Basics', [
//         ['name' => 'Lesson 1', 'module' => 'Basics'],
//         ['name' => 'Lesson 2', 'module' => 'Basics'],
//     ]],
//     ['Advanced', [
//         ['name' => 'Lesson 3', 'module' => 'Advanced'],
//         ['name' => 'Lesson 4', 'module' => 'Advanced'],
//     ]],
//     ['Basics', [
//         ['name' => 'Lesson 5', 'module' => 'Basics'],
//     ]],
// ];

Full signature: sectionBy($callback, $preserveKeys, $sectionKey, $itemsKey)

simplePaginate

Create a Paginator instance for the items in the collection.

collect($posts)->simplePaginate(5);

This paginates the contents of $posts with 5 items per page. simplePaginate accepts quite some options, head over to the Laravel docs for an in-depth guide.

simplePaginate(int $perPage = 15, string $pageName = 'page', int $page = null, int $total = null, array $options = [])

For a in-depth guide on pagination, check out the Laravel docs.

sliceBefore

Slice the values out from a collection before the given callback is true. If the optional parameter $preserveKeys as true is passed, it will preserve the original keys.

collect([20, 51, 10, 50, 66])->sliceBefore(function($item) {
    return $item > 50;
}); // return collect([[20],[51, 10, 50], [66])

tail

Extract the tail from a collection. So everything except the first element. It's a shorthand for slice(1)->values(), but nevertheless very handy. If the optional parameter $preserveKeys as true is passed, it will preserve the keys and fallback to slice(1).

collect([1, 2, 3])->tail(); // return collect([2, 3])

toPairs

Transform a collection into an array with pairs.

$collection = collect(['a' => 'b', 'c' => 'd', 'e' => 'f'])->toPairs();

$collection->toArray(); // returns ['a', 'b'], ['c', 'd'], ['e', 'f']

transpose

The goal of transpose is to rotate a multidimensional array, turning the rows into columns and the columns into rows.

collect([
    ['Jane', 'Bob', 'Mary'],
    ['[email protected]', '[email protected]', '[email protected]'],
    ['Doctor', 'Plumber', 'Dentist'],
])->transpose()->toArray();

// [
//     ['Jane', '[email protected]', 'Doctor'],
//     ['Bob', '[email protected]', 'Plumber'],
//     ['Mary', '[email protected]', 'Dentist'],
// ]

try

If any of the methods between try and catch throw an exception, then the exception can be handled in catch.

collect(['a', 'b', 'c', 1, 2, 3])
    ->try()
    ->map(fn ($letter) => strtoupper($letter))
    ->each(function() {
        throw new Exception('Explosions in the sky');
    })
    ->catch(function (Exception $exception) {
        // handle exception here
    })
    ->map(function() {
        // further operations can be done, if the exception wasn't rethrow in the `catch`
    });

While the methods are named try/catch for familiarity with PHP, the collection itself behaves more like a database transaction. So when an exception is thrown, the original collection (before the try) is returned.

You may gain access to the collection within catch by adding a second parameter to your handler. You may also manipulate the collection within catch by returning a value.

$collection = collect(['a', 'b', 'c', 1, 2, 3])
    ->try()
    ->map(function ($item) {
        throw new Exception();
    })
    ->catch(function (Exception $exception, $collection) {
        return collect(['d', 'e', 'f']);
    })
    ->map(function ($item) {
        return strtoupper($item);
    });

// ['D', 'E', 'F']

validate

Returns true if the given $callback returns true for every item. If $callback is a string or an array, regard it as a validation rule.

collect(['foo', 'foo'])->validate(function ($item) {
   return $item === 'foo';
}); // returns true


collect(['[email protected]', 'bla'])->validate('email'); // returns false
collect(['[email protected]', '[email protected]'])->validate('email'); // returns true

withSize

Create a new collection with the specified amount of items.

Collection::withSize(1)->toArray(); // return [1];
Collection::withSize(5)->toArray(); // return [1,2,3,4,5];

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

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

Credits

About Spatie

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

License

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

Comments
  • Collect by

    Collect by

    actually i see this method in Ruby .. and it's really awesome to add it to collections ..

    collectBy method is the GroupBy based on conditions instead of array key

    for example :

    $emails = collect([
            ["name" => "Ahmed Ashraf" , "email" => "[email protected]"],
            ["name" => "Mahmoud Ashraf" , "email" => "[email protected]"],
            ["name" => "Mohamed Fergany" , "email" => "[email protected]"],
            ["name" => "Mohamed Tayee" , "email" => "[email protected]"],
    ]);
    

    to split the array and get all @speakol members

    $emails->collectBy(function($row){
        return strpos($row['email'],'@speakol') !== false;
    })
    

    the result :

    array(
       [
            ["name" => "Ahmed Ashraf" , "email" => "[email protected]"],
            ["name" => "Mohamed Fergany" , "email" => "[email protected]"],
        ],
        [
            ["name" => "Mahmoud Ashraf" , "email" => "[email protected]"],
            ["name" => "Mohamed Tayee" , "email" => "[email protected]"],
        ]
    );
    
    opened by ahmedash95 9
  • Starts research on how to refactor.

    Starts research on how to refactor.

    Hey @freekmurze !

    Gave a little start, would like to check in with you. Still not mergeable, just for you too see if you like the looks.

    • Folder name is MacroClasses, but will be only Macros, once the macros can be deleted.

    • I put each macro, in each Class, with only one method. You like it like this, or just one class, and each method will be a macro?

    • Should we care right now with static analysis, as Larastan, or IDE-Helper?

    Thanks

    opened by ijpatricio 8
  • Add `path` macro

    Add `path` macro

    Always when we want to get the data from a collection with multidimensional arrays, it was a way to use pull or multidimensional collections with ->get()->get() which is not very elegant. The pull works well, but it actually removes the item from the collection besides retrieving. Most times working in Laravel I wanted to use dot notation, but to leave the item in the collection as other parts of the application might want access that data as well. The new method getDeeply works in a similar way as pull (using dot notation), but without removing an item from the collection.

    opened by michael-rubel 6
  • Add pluckMany macro

    Add pluckMany macro

    Hi, I was about to create a package for this, but I found yours and thought it would be better here.

    This is a macro to pluck more than one key from a collection at a time.

    Example usage

    $collection = collect([
        ['a' => 1, 'b' => 10, 'c' => 100],
        ['a' => 2, 'b' => 20, 'c' => 200],
    ]);
    
    $collection->pluckMany(['a', 'b']);
    
    // returns
    // collect([
    //     ['a' => 1, 'b' => 10],
    //     ['a' => 2, 'b' => 20],
    // ]);
    

    This is the same behaviour as a line like $collection->map->only(['name', 'email']), but the macro is more convenient and works on items of various types (e.g. not just items of type Collection, but also arrays, objects, objects that implement the ArrayAccess interface, and any combination of these).

    Here is its behaviour on items of various types:

    $collection = collect([
        ['id' => 1, 'name' => 'matt', 'hobby' => 'coding'],
        (object) ['id' => 2, 'name' => 'tomo', 'hobby' => 'cooking'],
        new ImplementsArrayAccess(['id' => 3, 'name' => 'marco', 'hobby' => 'drinking']),
        collect(['id' => 4, 'name' => 'belle', 'hobby' => 'cross-stitch']),
    ]);
    
    $collection->pluckMany(['name', 'hobby']);
    
    // returns a new Collection object:
    // collect([
    //     ['name' => 'matt', 'hobby' => 'coding'],
    //     (object) ['name' => 'tomo', 'hobby' => 'cooking'],
    //     ['name' => 'marco', 'hobby' => 'drinking'],
    //     collect(['name' => 'belle', 'hobby' => 'cross-stitch']),
    // ])
    

    Design decisions

    • When an item implements the ArrayAccess interface, it's converted into a plain array. I felt like this was the most intuitive behaviour because it ensures the interface to access its keys stays the same.

    Impact

    This shouldn't affect any existing macros as it's the addition of a self-contained new one.

    opened by shugyosha89 5
  • Add support for preserve original array keys in 4 recently added methods

    Add support for preserve original array keys in 4 recently added methods

    • tail
    • eachCons
    • sliceBefore
    • chunkBy

    have all now an optional parameter to preserve the keys. Needed that feature myself in some use cases. So that the parameter is optional, it shouldn't be a breaking change.

    Refactoring the sliceBefore method was quite tricky to preserve the keys. I'm not so satisfied with the implementation. Maybe someone else can streamline the method a bit?

    opened by ghost 5
  • Add Transpose Macro

    Add Transpose Macro

    • Add transpose macro
    • Add test for transpose macro

    Adding the transpose maco based on a post from Adam Wathan's blog. I've found this to be pretty handy and end up adding it to most projects.

    opened by sixlive 5
  • Add containsAll, containsAny and doesNotContain in Collection Macros

    Add containsAll, containsAny and doesNotContain in Collection Macros

    This PR to add containsAll,containsAny and doesNotContain in to Collection. These functions allow checking the presence of any, none, or all values.

    ِExamples for use:

    
    use Illuminate\Http\Request;
    
    class UserController
    {
        public function __invoke(Request $request)
        {
            $request->validate([
                'names' => ['required', 'array'],
            ]);
    
            $names = $request->collect('names');
    
            if ($names->containsAll(['Freek', 'Michael'])) {
                # code...
            }
    
            if ($names->containsAny(['Freek Van der Herten', 'Michael Nabil', 'Khaled Ahmed'])) {
                # code...
            }
    
            if ($names->doesNotContain(['Marian', 'Ahmed', 'Menna'])) {
                # code...
            }
        }
    }
    

    Another example:

    
    use Illuminate\Http\Request;
    
    class BookController
    {
        public function __invoke(Request $request)
        {
            $books = ['book1', 'book2', 'book3'];
            
            if (collect($books)->containsAll(['book1', 'book2'])) {
                # code...
            }
    
            if (collect($books)->containsAny(['book1', 'book2', 'book5', 'book6'])) {
                # code...
            }
    
            if (collect($books)->doesNotContain(['book4', 'book5'])) {
                # code...
            }
        }
    }
    
    
    
    opened by michaelnabil230 4
  • Add toSentence macro

    Add toSentence macro

    This adds a toSentence macro which can be used to turn a collection of items into a sentence.

    $subjects = collect(['Business', 'Legal Studies', 'Mathematics']);
    
    $subjects->toSentence(); // Business, Legal Studies & Mathematics
    

    Used this for a while, generally inspired by Rails' to_sentence.

    opened by dwightwatson 4
  • Use registry over file scan + string manipulation

    Use registry over file scan + string manipulation

    This contains the refactors we discussed in our pairing session to remove the file system scans on register.

    In doing so, this registry of macro/FQCN removed the need for the logic to build the class and macro names, as well as the special condition added for try.

    Also adds the missing tests annotations for the TryCatchTest to remove the risky test.

    opened by jasonmccreary 4
  • Allow a single array to be transposed.

    Allow a single array to be transposed.

    The previous implementation used array_intersect_key to detect the number of elements in each "row" and ensure they were all equal before transposing.

    The trouble with this is that it required a minimum of 2 "rows" (arrays) to check otherwise an array_intersect_key(): at least 2 parameters are required, 1 given error was thrown.

    This PR takes a stab at trying to get around this issue, as cleanly as I could, whilst maintaining the check that all "rows" should have the same number of elements before a transpose is allowed to take place. Tests included.

    I needed this functionality because whilst looping over a batch of results in a collection, 1 or 2 of them happened to be single array and the next transpose operation was blowing up because of this.

    I could have broken out of the collection pipeline and attempted a manual map if the number of rows was equal to 1 - but man, that was ugly!

    opened by jonnywilliamson 4
  • Laravel 8.x Compatibility

    Laravel 8.x Compatibility

    This is an automated pull request from Shift to update your package code and dependencies to be compatible with Laravel 8.x.

    Before merging, you need to:

    • Checkout the l8-compatibility branch
    • Review all comments for additional changes
    • Thoroughly test your package

    If you do find an issue, please report it by commenting on this PR to help improve future automation.

    opened by laravel-shift 3
Releases(7.12.2)
Owner
Spatie
Webdesign agency based in Antwerp, Belgium
Spatie
A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDowell

PHPAlgorithms A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDow

Doğan Can Uçar 921 Dec 18, 2022
Useful blade components and functionality for most Laravel projects.

laravel-base Note: Package is still in early stages of development, so functionality is subject to change. LaravelBase is a package I've created to pr

Randall Wilk 3 Jan 16, 2022
A light weight laravel package that facilitates dealing with arabic concepts using a set of classes and methods to make laravel speaks arabic

A light weight laravel package that facilitates dealing with arabic concepts using a set of classes and methods to make laravel speaks arabic! concepts like , Hijri Dates & Arabic strings and so on ..

Adnane Kadri 49 Jun 22, 2022
Laravel-OvalFi helps you Set up, test, and manage your OvalFi integration directly in your Laravel App.

OvalFi Laravel Package Laravel-OvalFi helps you Set up, test, and manage your OvalFi integration directly in your Laravel App. Installation You can in

Paul Adams 2 Sep 8, 2022
Collection of the Laravel/Eloquent Model classes that allows you to get data directly from a Magento 2 database.

Laragento LAravel MAgento Micro services Magento 2 has legacy code based on abandoned Zend Framework 1 with really ugly ORM on top of outdated Zend_DB

Egor Shitikov 87 Nov 26, 2022
A collection of generators for Lumen and Laravel 5.

Lumen generators A collection of generators for Lumen and Laravel 5. Contents Why ? Installation Quick Usage Detailed Usage Model Generator Migration

Amine Ben hammou 349 Mar 24, 2022
A collection of extensions for Laravel development in Visual Studio Code

Laravel Extension Pack for Visual Studio Code Includes the basic extensions to get started with Laravel development in Visual Studio Code. Laravel Ext

Winnie Lin 24 Dec 25, 2022
A package to filter laravel model based on query params or retrieved model collection

Laravel Filterable A package to filter laravel model based on query params or retrived model collection. Installation Require/Install the package usin

Touhidur Rahman 17 Jan 20, 2022
Collection of classes you can use to standardize data formats in your Laravel application.

Laravel Formatters This package is a collection of classes you can use to standardize data formats in your Laravel application. It uses the Service Co

Michael Rubel 88 Dec 23, 2022
A collection of classes to be extended/used in laravel apps for quick development

laraquick A collection of classes to be extended/used in laravel applications for quick development. Introduction The library contains traits with wel

Ezra Obiwale 35 Dec 13, 2022
Collection of Google Maps API Web Services for Laravel

Collection of Google Maps API Web Services for Laravel Provides convenient way of setting up and making requests to Maps API from Laravel application.

Alexander Pechkarev 467 Jan 5, 2023
A query database collection for use with Laravel Pipeline

A query database collection for use with Laravel Pipeline This package contains a collection of class that can be used with Laravel Pipeline. Let's se

Dương Gia Bảo 188 Dec 24, 2022
A collection of pre-made simple Laravel Blade form components.

Laravel Form Components Library A collection of pre-made simple Laravel Blade form components. Installation & setup You can install the package via co

null 3 Oct 5, 2022
⛽ Set of utilities to test Laravel applications powered by Octane.

⛽ Octane Testbench Set of utilities to test Laravel applications powered by Octane. Install Via Composer: composer require --dev cerbero/octane-testbe

Andrea Marco Sartori 35 Dec 7, 2022
Update multiple Laravel Model records, each with it's own set of values, sending a single query to your database!

Laravel Mass Update Update multiple Laravel Model records, each with its own set of values, sending a single query to your database! Installation You

Jorge González 88 Dec 31, 2022
Cagilo - a set of simple components for use in your views Laravel Blade.

Cagilo - a set of simple components for use in your views Laravel Blade. Official Documentation Documentation for Cagilo can be found on its we

Cagilo 151 Dec 6, 2022
This package gives you a set of conventions to make the most out of Hotwire in Laravel

Introduction This package gives you a set of conventions to make the most out of Hotwire in Laravel (inspired by the turbo-rails gem). There is a comp

Tony Messias 665 Jan 2, 2023
Laracademy Generators - is a tool set that helps speed up the development process of a Laravel application.

Laracademy Generators Laracademy Generators - is a tool set that helps speed up the development process of a Laravel application. Author(s): Laracadem

Laracademy 320 Dec 24, 2022
Laravel package for giving admin-created accounts to users via 'set-password' email.

Invytr When making a website where users are created instead of registering themselves, you are faced with the challenge of safely giving users the ac

GlaivePro 64 Jul 17, 2022