1 | <?php |
||
21 | class Supplier extends Eloquent\Model |
||
22 | { |
||
23 | use Eloquent\SoftDeletes; |
||
24 | |||
25 | /** |
||
26 | * We do not want any timestamps. |
||
27 | * |
||
28 | * @var bool |
||
29 | */ |
||
30 | public $timestamps = false; |
||
31 | /** |
||
32 | * @var array |
||
33 | */ |
||
34 | protected $dates = ['deleted_at']; |
||
35 | /** |
||
36 | * The attributes that are mass assignable. |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $fillable = ['name', 'location']; |
||
41 | |||
42 | 11 | public static function boot() |
|
50 | |||
51 | /** |
||
52 | * Make a purchase. |
||
53 | * |
||
54 | * @param array $attributes |
||
55 | * |
||
56 | * @return Purchase |
||
57 | */ |
||
58 | 1 | public function makePurchase(array $attributes) |
|
62 | |||
63 | /** |
||
64 | * Purchases from this supplier. |
||
65 | * |
||
66 | * @return Eloquent\Relations\HasMany |
||
67 | */ |
||
68 | 1 | public function purchases() |
|
72 | } |
||
73 |