Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
CustomerOptInHistory
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 customer
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 brand
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace App\Models;
4
5use Illuminate\Database\Eloquent\Factories\HasFactory;
6use Illuminate\Database\Eloquent\Model;
7
8/**
9 * @property integer $id                                 Id.
10 * @property integer $customer_id                        Foreign key Customer.
11 * @property integer $brand_id                           Foreign key Brand.
12 * @property boolean $new_value
13 * @property-read \Illuminate\Support\Carbon $created_at Created date.
14 * @property-read \Illuminate\Support\Carbon $updated_at Updated date.
15 *
16 * @property-read \App\Models\Customer $customer Customer BelongsTo relation.
17 * @property-read \App\Models\Brand    $brand Brand BelongsTo relation.
18 */
19class CustomerOptInHistory extends Model
20{
21    use HasFactory;
22
23    /**
24     * The table associated with the model.
25     *
26     * @var string
27     */
28    protected $table = "customer_opt_in_history";
29
30    /**
31     * The attributes that should be cast to native types.
32     *
33     * @var array
34     */
35    protected $casts = [
36        'new_value' => 'bool',
37    ];
38
39    // * RELATIONS
40
41    /**
42     * Customer BelongsTo relation.
43     *
44     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
45     */
46    public function customer(): \Illuminate\Database\Eloquent\Relations\BelongsTo
47    {
48        return $this->belongsTo(Customer::class);
49    }
50
51    /**
52     * Brand BelongsTo relation.
53     *
54     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
55     */
56    public function brand(): \Illuminate\Database\Eloquent\Relations\BelongsTo
57    {
58        return $this->belongsTo(Brand::class);
59    }
60}