2018-10-15 23:40:34 +11:00
|
|
|
<?php
|
2019-05-11 13:32:07 +10:00
|
|
|
/**
|
2020-09-06 19:38:10 +10:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-05-11 13:32:07 +10:00
|
|
|
*
|
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
|
*
|
2022-04-27 13:20:41 +10:00
|
|
|
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-05-11 13:32:07 +10:00
|
|
|
*
|
2021-06-16 16:58:16 +10:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2019-05-11 13:32:07 +10:00
|
|
|
*/
|
2018-10-15 23:40:34 +11:00
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
2022-01-03 12:14:24 +11:00
|
|
|
use App\Models\Filterable;
|
2018-11-20 15:36:56 +11:00
|
|
|
use App\Utils\Traits\MakesHash;
|
2020-02-26 17:46:27 +11:00
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
2018-10-15 23:40:34 +11:00
|
|
|
|
2018-11-02 21:54:46 +11:00
|
|
|
class TaxRate extends BaseModel
|
2018-10-15 23:40:34 +11:00
|
|
|
{
|
2018-11-20 15:36:56 +11:00
|
|
|
use MakesHash;
|
2020-02-26 17:46:27 +11:00
|
|
|
use SoftDeletes;
|
2022-01-03 12:14:24 +11:00
|
|
|
use Filterable;
|
2022-06-21 09:57:17 +00:00
|
|
|
|
2019-06-26 14:04:10 +10:00
|
|
|
protected $fillable = [
|
2019-12-31 08:59:12 +11:00
|
|
|
'name',
|
2020-09-06 19:38:10 +10:00
|
|
|
'rate',
|
2019-12-31 08:59:12 +11:00
|
|
|
];
|
2018-11-20 15:36:56 +11:00
|
|
|
|
2021-09-10 21:40:49 +10:00
|
|
|
// protected $appends = ['tax_rate_id'];
|
2018-11-20 15:36:56 +11:00
|
|
|
|
2020-05-06 21:49:42 +10:00
|
|
|
public function getEntityType()
|
|
|
|
|
{
|
2020-09-06 19:38:10 +10:00
|
|
|
return self::class;
|
2020-05-06 21:49:42 +10:00
|
|
|
}
|
|
|
|
|
|
2018-11-20 15:36:56 +11:00
|
|
|
public function getRouteKeyName()
|
|
|
|
|
{
|
|
|
|
|
return 'tax_rate_id';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getTaxRateIdAttribute()
|
|
|
|
|
{
|
|
|
|
|
return $this->encodePrimaryKey($this->id);
|
|
|
|
|
}
|
2018-10-15 23:40:34 +11:00
|
|
|
}
|