2018-10-15 14:40:34 +02:00
|
|
|
<?php
|
2019-05-11 05:32:07 +02:00
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-05-11 05:32:07 +02:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2023-01-28 23:21:40 +01:00
|
|
|
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-05-11 05:32:07 +02:00
|
|
|
*
|
2021-06-16 08:58:16 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2019-05-11 05:32:07 +02:00
|
|
|
*/
|
2018-10-15 14:40:34 +02:00
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
2018-11-20 05:36:56 +01:00
|
|
|
use App\Utils\Traits\MakesHash;
|
2020-02-26 07:46:27 +01:00
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
2018-10-15 14:40:34 +02:00
|
|
|
|
2023-03-08 08:33:42 +01:00
|
|
|
/**
|
|
|
|
* App\Models\TaxRate
|
|
|
|
*
|
|
|
|
* @property int $id
|
|
|
|
* @property int $company_id
|
|
|
|
* @property int|null $user_id
|
|
|
|
* @property int|null $created_at
|
|
|
|
* @property int|null $updated_at
|
|
|
|
* @property int|null $deleted_at
|
|
|
|
* @property string $name
|
2023-04-29 01:32:20 +02:00
|
|
|
* @property float $rate
|
|
|
|
* @property bool $is_deleted
|
2023-03-08 08:33:42 +01:00
|
|
|
* @property-read mixed $hashed_id
|
|
|
|
* @property-read mixed $tax_rate_id
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel company()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns)
|
|
|
|
* @method static \Database\Factories\TaxRateFactory factory($count = null, $state = [])
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate filter(\App\Filters\QueryFilters $filters)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate newModelQuery()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate newQuery()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate onlyTrashed()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate query()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereCompanyId($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereCreatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereDeletedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereId($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereIsDeleted($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereName($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereRate($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereUpdatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate whereUserId($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate withTrashed()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate withoutTrashed()
|
2023-08-07 07:30:34 +02:00
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|TaxRate firstOrNew()
|
2023-03-08 08:33:42 +01:00
|
|
|
* @mixin \Eloquent
|
|
|
|
*/
|
2018-11-02 11:54:46 +01:00
|
|
|
class TaxRate extends BaseModel
|
2018-10-15 14:40:34 +02:00
|
|
|
{
|
2018-11-20 05:36:56 +01:00
|
|
|
use MakesHash;
|
2020-02-26 07:46:27 +01:00
|
|
|
use SoftDeletes;
|
2022-01-03 02:14:24 +01:00
|
|
|
use Filterable;
|
2022-06-21 11:57:17 +02:00
|
|
|
|
2019-06-26 06:04:10 +02:00
|
|
|
protected $fillable = [
|
2019-12-30 22:59:12 +01:00
|
|
|
'name',
|
2020-09-06 11:38:10 +02:00
|
|
|
'rate',
|
2019-12-30 22:59:12 +01:00
|
|
|
];
|
2018-11-20 05:36:56 +01:00
|
|
|
|
2021-09-10 13:40:49 +02:00
|
|
|
// protected $appends = ['tax_rate_id'];
|
2018-11-20 05:36:56 +01:00
|
|
|
|
2020-05-06 13:49:42 +02:00
|
|
|
public function getEntityType()
|
|
|
|
{
|
2020-09-06 11:38:10 +02:00
|
|
|
return self::class;
|
2020-05-06 13:49:42 +02:00
|
|
|
}
|
|
|
|
|
2018-11-20 05:36:56 +01:00
|
|
|
public function getRouteKeyName()
|
|
|
|
{
|
|
|
|
return 'tax_rate_id';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getTaxRateIdAttribute()
|
|
|
|
{
|
|
|
|
return $this->encodePrimaryKey($this->id);
|
|
|
|
}
|
2018-10-15 14:40:34 +02:00
|
|
|
}
|