| Total Complexity | 2 | 
| Total Lines | 70 | 
| Duplicated Lines | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 25 | class Rate extends Model | ||
| 26 | { | ||
| 27 | use Migratable; | ||
| 28 | use SoftDeletes; | ||
| 29 | |||
| 30 | /** | ||
| 31 | * The attributes that should be casted to Carbon dates. | ||
| 32 | * | ||
| 33 | * @var string[] | ||
| 34 | */ | ||
| 35 | protected $dates = ['deleted_at']; | ||
| 36 | |||
| 37 | /** | ||
| 38 | * The attributes that can be filled. | ||
| 39 | * | ||
| 40 | * @var string[] | ||
| 41 | */ | ||
| 42 | public $fillable = [ | ||
| 43 | 'rate', | ||
| 44 | 'name', | ||
| 45 | 'compound', | ||
| 46 | 'shipping', | ||
| 47 | 'type', | ||
| 48 | ]; | ||
| 49 | |||
| 50 | /** | ||
| 51 | * The attributes that should be casted to native types. | ||
| 52 | * | ||
| 53 | * @var array | ||
| 54 | */ | ||
| 55 | protected $casts = [ | ||
| 56 | 'rate' => 'float', | ||
| 57 | 'name' => 'string', | ||
| 58 | 'compound' => 'boolean', | ||
| 59 | 'shipping' => 'boolean', | ||
| 60 | ]; | ||
| 61 | |||
| 62 | /** | ||
| 63 | * Validation rules. | ||
| 64 | * | ||
| 65 | * @var array | ||
| 66 | */ | ||
| 67 | public static $rules = [ | ||
| 68 | 'rate' => 'required', | ||
| 69 | 'name' => 'required', | ||
| 70 | 'type' => 'required', | ||
| 71 | ]; | ||
| 72 | |||
| 73 | /** | ||
| 74 | * Constructor. | ||
| 75 | * | ||
| 76 | * @param array $attributes additional attributes for model initialisation | ||
| 77 | * | ||
| 78 | * @return void | ||
| 79 | */ | ||
| 80 | public function __construct(array $attributes = []) | ||
| 81 |     { | ||
| 82 | parent::__construct($attributes); | ||
| 83 | |||
| 84 |         $this->setTable(config('pwweb.localisation.table_names.tax.rates')); | ||
| 85 | } | ||
| 86 | |||
| 87 | /** | ||
| 88 | * Accessor for linked Location model. | ||
| 89 | * | ||
| 90 | * @return \Illuminate\Database\Eloquent\Relations\HasMany | ||
| 91 | **/ | ||
| 92 | public function country(): HasMany | ||
| 95 | } | ||
| 96 | } | ||
| 97 |