All Projects → faustbrian → Laravel Collectable

faustbrian / Laravel Collectable

Licence: mpl-2.0

Projects that are alternatives of or similar to Laravel Collectable

Laravel Helpers
An extensive set of Laravel framework helper functions and collection macros.
Stars: ✭ 407 (+5714.29%)
Mutual labels:  collections, laravel
Stream Parser
⚡ PHP7 / Laravel Multi-format Streaming Parser
Stars: ✭ 391 (+5485.71%)
Mutual labels:  collections, laravel
Laravel Widgetize
A minimal package to help you make your laravel application cleaner and faster.
Stars: ✭ 791 (+11200%)
Mutual labels:  laravel
Laravel Like Vue Validator
An input validator mixin for Vue.js
Stars: ✭ 7 (+0%)
Mutual labels:  laravel
Laravel Jade
[Discontinued] Laravel package that adds Jade templating support
Stars: ✭ 5 (-28.57%)
Mutual labels:  laravel
Laravel5 Cheatsheet
A quick reference guide (cheat sheet) for Laravel 5.1 LTS, listing artisan, composer, routes and other useful bits of information.
Stars: ✭ 799 (+11314.29%)
Mutual labels:  laravel
Barcode
Laravel 5 Barcode Generator
Stars: ✭ 826 (+11700%)
Mutual labels:  laravel
Laravel Google Calendar
Manage events on a Google Calendar
Stars: ✭ 787 (+11142.86%)
Mutual labels:  laravel
Laravel Uptime Monitor
A powerful and easy to configure uptime and ssl monitor
Stars: ✭ 837 (+11857.14%)
Mutual labels:  laravel
Transit
Easy file uploading and downloading for Laravel 5.
Stars: ✭ 5 (-28.57%)
Mutual labels:  laravel
Laravel Sluggable
An opinionated package to create slugs for Eloquent models
Stars: ✭ 831 (+11771.43%)
Mutual labels:  laravel
Laravel Event Broadcast
Laravel event broadcasting with Node.js, Redis & Socket.io
Stars: ✭ 5 (-28.57%)
Mutual labels:  laravel
Laravel Ffmpeg
This package provides an integration with FFmpeg for Laravel. Laravel's Filesystem handles the storage of the files.
Stars: ✭ 807 (+11428.57%)
Mutual labels:  laravel
Menu
Menu and sidebar management package for Laravel
Stars: ✭ 6 (-14.29%)
Mutual labels:  laravel
Repository
Laravel Repositories is a package for Laravel 5 which is used to abstract the database layer. This makes applications much easier to maintain.
Stars: ✭ 795 (+11257.14%)
Mutual labels:  laravel
Aetherupload Laravel
A Laravel package to upload large files 上传大文件的Laravel扩展包
Stars: ✭ 835 (+11828.57%)
Mutual labels:  laravel
Laravel Notify
Flexible Flash notifications for Laravel
Stars: ✭ 787 (+11142.86%)
Mutual labels:  laravel
Laravel Love
Add Social Reactions to Laravel Eloquent Models. It lets people express how they feel about the content. Fully customizable Weighted Reaction System & Reaction Type System with Like, Dislike and any other custom emotion types. Do you react?
Stars: ✭ 822 (+11642.86%)
Mutual labels:  laravel
Adldap2 Laravel
LDAP Authentication & Management for Laravel
Stars: ✭ 825 (+11685.71%)
Mutual labels:  laravel
Lvlgrid
✨ Grid helper to your Laravel application. Filter, order and pagination ajax
Stars: ✭ 7 (+0%)
Mutual labels:  laravel

Laravel Collectable

Build Status PHP from Packagist Latest Version License

Installation

Require this package, with Composer, in the root directory of your project.

$ composer require artisanry/collectable

To get started, you'll need to publish the vendor assets and migrate:

php artisan vendor:publish --provider="Artisanry\Collectable\CollectableServiceProvider" && php artisan migrate

Usage

Setup a Model
<?php

namespace App;

use Artisanry\Collectable\Traits\HasCollections;
use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    use HasCollections;
}
Add an item to the collection.
$user->collection('favorites')->push($model);
Determine if an item exists in the collection for a given model.
$user->collection('favorites')->has($model);
Get the first item from the collection.
$user->collection('favorites')->first();
Retrieve an item from the collection by model.
$user->collection('favorites')->get($model);
Get all of the items from the collection.
$user->collection('favorites')->all();
Remove an item from the collection.
$user->collection('favorites')->forget($model);
Remove all items from the collection.
$user->collection('favorites')->flush();
Set the item-type that should be filtered by.
$user->collection('favorites')->type(Post::class)->all();

Testing

$ phpunit

Security

If you discover a security vulnerability within this package, please send an e-mail to [email protected]. All security vulnerabilities will be promptly addressed.

Credits

This project exists thanks to all the people who contribute.

License

Mozilla Public License Version 2.0 (MPL-2.0).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].