Issues (50)

src/Models/Breakdown.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\Enums\TaxType;
11
use Squareetlabs\VeriFactu\Enums\RegimeType;
12
use Squareetlabs\VeriFactu\Enums\OperationType;
13
14
class Breakdown extends Model
15
{
16
    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\Breakdown.
Loading history...
17
    use SoftDeletes;
18
19
    protected static function newFactory()
20
    {
21
        return \Database\Factories\Squareetlabs\VeriFactu\Models\BreakdownFactory::new();
22
    }
23
24
    protected $table = 'breakdowns';
25
26
    protected $fillable = [
27
        'invoice_id',
28
        'tax_type',
29
        'regime_type',
30
        'operation_type',
31
        'tax_rate',
32
        'base_amount',
33
        'tax_amount',
34
    ];
35
36
    protected $casts = [
37
        'tax_type' => TaxType::class,
38
        'regime_type' => RegimeType::class,
39
        'operation_type' => OperationType::class,
40
        'tax_rate' => 'decimal:2',
41
        'base_amount' => 'decimal:2',
42
        'tax_amount' => 'decimal:2',
43
    ];
44
45
    public function invoice()
46
    {
47
        return $this->belongsTo(Invoice::class);
48
    }
49
}