| Total Complexity | 6 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class InvoiceLine extends Model |
||
| 9 | { |
||
| 10 | protected $guarded = []; |
||
| 11 | |||
| 12 | public $incrementing = false; |
||
| 13 | |||
| 14 | protected $fillable = [ |
||
| 15 | 'amount', 'tax', 'tax_details', 'invoice_id', 'description', 'invoiceable_id', |
||
| 16 | 'invoiceable_type', 'name', 'discount', 'quantity', 'is_free', 'is_complimentary' |
||
| 17 | ]; |
||
| 18 | |||
| 19 | protected $casts = [ |
||
| 20 | 'tax_details' => 'array' |
||
| 21 | ]; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * InvoiceLine constructor. |
||
| 25 | * @param array $attributes |
||
| 26 | */ |
||
| 27 | public function __construct(array $attributes = []) |
||
| 28 | { |
||
| 29 | parent::__construct($attributes); |
||
| 30 | |||
| 31 | $this->setTable(config('soap.invoices.table_names.invoice_lines')); |
||
| 32 | } |
||
| 33 | |||
| 34 | protected static function boot() |
||
| 43 | } |
||
| 44 | }); |
||
| 45 | } |
||
| 46 | |||
| 47 | public function invoice() |
||
| 48 | { |
||
| 49 | return $this->belongsTo(Invoice::class); |
||
| 50 | } |
||
| 51 | |||
| 52 | public function bill() |
||
| 53 | { |
||
| 54 | return $this->belongsTo(Bill::class, 'invoice_id'); |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Get the owning invoiceable model. |
||
| 59 | */ |
||
| 60 | public function invoiceable() |
||
| 63 | } |
||
| 64 | } |
||
| 65 |