| 1 | <?php |
||
| 2 | |||
| 3 | namespace Soap\Invoices\Traits; |
||
| 4 | |||
| 5 | use Soap\Invoices\Models\Bill; |
||
| 6 | use Soap\Invoices\Models\Invoice; |
||
| 7 | use Soap\Invoices\Models\InvoiceLine; |
||
| 8 | |||
| 9 | trait HasInvoices |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Set the polymorphic relation. |
||
| 13 | * |
||
| 14 | * @return mixed |
||
| 15 | */ |
||
| 16 | public function invoices() |
||
| 17 | { |
||
| 18 | return $this->morphMany(Invoice::class, 'related'); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @return mixed |
||
| 23 | */ |
||
| 24 | public function bills() |
||
| 25 | { |
||
| 26 | return $this->morphMany(Bill::class, 'related'); |
||
| 27 | } |
||
| 28 | } |
||
| 29 |