Recipient::newFactory()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Squareetlabs\VeriFactu\Models;
6
7
use Illuminate\Database\Eloquent\Model;
8
use Illuminate\Database\Eloquent\SoftDeletes;
9
use Illuminate\Database\Eloquent\Factories\HasFactory;
10
use Squareetlabs\VeriFactu\Contracts\VeriFactuRecipient;
11
12
class Recipient extends Model implements VeriFactuRecipient
13
{
14
    use HasFactory;
0 ignored issues
show
Bug introduced by
The trait Illuminate\Database\Eloquent\Factories\HasFactory requires the property $factoryClass which is not provided by Squareetlabs\VeriFactu\Models\Recipient.
Loading history...
15
    use SoftDeletes;
16
17
    protected static function newFactory()
18
    {
19
        return \Database\Factories\Squareetlabs\VeriFactu\Models\RecipientFactory::new();
20
    }
21
22
    protected $table = 'recipients';
23
24
    protected $fillable = [
25
        'invoice_id',
26
        'name',
27
        'tax_id',
28
        'country',
29
        'id_type', // New field from PR #8 for foreign recipients
30
        // Otros campos relevantes
31
    ];
32
33
    public function invoice()
34
    {
35
        return $this->belongsTo(Invoice::class);
36
    }
37
38
    // VeriFactuRecipient Contract Implementation
39
40
    public function getName(): string
41
    {
42
        return $this->name;
43
    }
44
45
    public function getTaxId(): ?string
46
    {
47
        return $this->tax_id;
48
    }
49
}