Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
66.67% |
2 / 3 |
|
66.67% |
2 / 3 |
CRAP | |
0.00% |
0 / 1 |
| UserAddOns | |
66.67% |
2 / 3 |
|
66.67% |
2 / 3 |
3.33 | |
0.00% |
0 / 1 |
| user | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| addOn | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| newFactory | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Http\Models; |
| 4 | |
| 5 | use Database\Factories\Http\Models\UserAddOnsFactory; |
| 6 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
| 7 | use MongoDB\Laravel\Eloquent\SoftDeletes; |
| 8 | |
| 9 | class UserAddOns extends Moloquent |
| 10 | { |
| 11 | use HasFactory, SoftDeletes; |
| 12 | |
| 13 | protected $fillable = [ |
| 14 | 'user_id', |
| 15 | 'add_on_id', |
| 16 | 'stripe_id', |
| 17 | 'stripe_price_id', |
| 18 | 'quantity', |
| 19 | 'status', |
| 20 | 'starts_at', |
| 21 | 'ends_at', |
| 22 | 'product', |
| 23 | 'created_at', |
| 24 | 'updated_at', |
| 25 | ]; |
| 26 | |
| 27 | public function user() |
| 28 | { |
| 29 | return $this->belongsTo(User::class, 'user_id'); |
| 30 | } |
| 31 | |
| 32 | public function addOn() |
| 33 | { |
| 34 | return $this->belongsTo(AddOns::class, 'add_on_id'); |
| 35 | } |
| 36 | |
| 37 | protected static function newFactory() |
| 38 | { |
| 39 | return UserAddOnsFactory::new(); |
| 40 | } |
| 41 | } |