Issues (60)

src/Models/Recipient.php (1 issue)

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
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
}