2017 © Pedro Peláez
 

library laravel-deliverable

Trait for Laravel Eloquent models to allow easy implementation of delivering feature.

image

ironshark/laravel-deliverable

Trait for Laravel Eloquent models to allow easy implementation of delivering feature.

  • Thursday, September 3, 2015
  • by TUNER88
  • Repository
  • 4 Watchers
  • 4 Stars
  • 181 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Laravel Deliverable Plugin

License Downloads Version-stable, (*1)

Trait for Laravel Eloquent models to allow easy implementation of a "deliverable" feature. Can be used for reading lists or shipments., (*2)

Composer Install

composer require ironshark/laravel-deliverable
php artisan vendor:publish --provider="IronShark\Deliverable\DeliverableServiceProvider"
php artisan migrate

Setup your models

class Article extends \Illuminate\Database\Eloquent\Model {
    use IronShark\Deliverable\DeliverableTrait;
}

Sample Usage

$file = File::create(['name' => 'filename']);
$admin = \App\User::where('name', 'admin')->first();

$file->deliver(\App\User::all()); // deliver file to all users
$file->deliver(1, 5); // deliver files to user with id `1`, priority = `5`

$file->setDelivered(); // mark file as deliverd to logged in user
$file->setDelivered(true, $admin); // mark file as deliverd to admin user

$file->isDelivered(); // check whether current item was delivered to current user (`true`|`false`)
$file->isDelivered($admin); // check whether current item was delivered to admin

$file->cancelDelivery(); // remove delivery tasks for current user
$file->cancelDelivery($admin); // remove delivery tasks for admin
$file->cancelDelivery([1,5,9,8]); // remove delivery tasks for specified user ids

DataBase sturcture

name datatype example
id INT 1
deliverable_id INT 34
deliverable_type VARCHAR(256) App\File
user_id INT 25
priority TINYINT 2
created_at DATETIME 2015-07-20 09:19:41
delivered_at DATETIME 2015-07-20 09:19:41

The Versions

03/09 2015

dev-master

9999999-dev

Trait for Laravel Eloquent models to allow easy implementation of delivering feature.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

laravel eloquent trait deliverable

26/08 2015

v1.0.1

1.0.1.0

Trait for Laravel Eloquent models to allow easy implementation of delivering feature.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

laravel eloquent trait deliverable

26/08 2015

dev-develop

dev-develop

Trait for Laravel Eloquent models to allow easy implementation of delivering feature.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

laravel eloquent trait deliverable

26/08 2015

1.0.0

1.0.0.0

Trait for Laravel Eloquent models to allow easy implementation of delivering feature.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

laravel eloquent trait deliverable