@@ 8-27 (lines=20) @@ | ||
5 | use Illuminate\Database\Eloquent\Model; |
|
6 | use Sagitarius29\LaravelSubscriptions\PlanFeature as PlanFeatureBase; |
|
7 | ||
8 | class PlanConsumable extends PlanFeatureBase |
|
9 | { |
|
10 | protected $attributes = [ |
|
11 | 'is_consumable' => true, |
|
12 | ]; |
|
13 | ||
14 | public static function make( |
|
15 | string $code, |
|
16 | int $value, |
|
17 | int $sortOrder = null |
|
18 | ): Model { |
|
19 | $attributes = [ |
|
20 | 'code' => $code, |
|
21 | 'value' => $value, |
|
22 | 'sort_order' => $sortOrder, |
|
23 | ]; |
|
24 | ||
25 | return new self($attributes); |
|
26 | } |
|
27 | } |
|
28 |
@@ 8-34 (lines=27) @@ | ||
5 | use Illuminate\Database\Eloquent\Model; |
|
6 | use Sagitarius29\LaravelSubscriptions\PlanFeature as PlanFeatureBase; |
|
7 | ||
8 | class PlanFeature extends PlanFeatureBase |
|
9 | { |
|
10 | protected $isConsumable = false; |
|
11 | ||
12 | /** |
|
13 | * @param string $code |
|
14 | * @param bool|int $value |
|
15 | * @param int $sortOrder |
|
16 | * @param bool $isConsumable |
|
17 | * @return Model |
|
18 | */ |
|
19 | public static function make( |
|
20 | string $code, |
|
21 | $value, |
|
22 | int $sortOrder = null |
|
23 | ): Model { |
|
24 | $attributes = [ |
|
25 | 'code' => $code, |
|
26 | 'value' => $value, |
|
27 | 'sort_order' => $sortOrder, |
|
28 | ]; |
|
29 | ||
30 | return new self($attributes); |
|
31 | } |
|
32 | } |
|
33 |