Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| SalePayment | |
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
2.50 | |
0.00% |
0 / 1 |
| sale | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| payment_type | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Models\admin; |
| 4 | |
| 5 | use App\Models\PaymentType; |
| 6 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
| 7 | use Illuminate\Database\Eloquent\Model; |
| 8 | |
| 9 | class SalePayment extends Model |
| 10 | { |
| 11 | use HasFactory; |
| 12 | |
| 13 | protected $table = 'sale_payments'; |
| 14 | |
| 15 | protected $fillable = [ |
| 16 | 'sale_id', |
| 17 | 'payment_type_id', |
| 18 | 'total', |
| 19 | 'paid', |
| 20 | 'due', |
| 21 | 'shipping_cost', |
| 22 | ]; |
| 23 | |
| 24 | public function sale() |
| 25 | { |
| 26 | return $this->belongsTo(Sale::class); |
| 27 | } |
| 28 | |
| 29 | public function payment_type() |
| 30 | { |
| 31 | return $this->belongsTo(PaymentType::class); |
| 32 | } |
| 33 | } |