2020-01-20 02:31:58 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2020-01-20 02:31:58 +01: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)
|
2020-01-20 02:31:58 +01:00
|
|
|
*
|
2021-06-16 08:58:16 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2020-01-20 02:31:58 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
2020-10-28 11:10:49 +01:00
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
2020-01-20 02:31:58 +01:00
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
|
2023-03-08 08:33:42 +01:00
|
|
|
/**
|
|
|
|
* App\Models\ExpenseCategory
|
|
|
|
*
|
|
|
|
* @property int $id
|
|
|
|
* @property int $user_id
|
|
|
|
* @property int $company_id
|
|
|
|
* @property string|null $name
|
|
|
|
* @property int|null $created_at
|
|
|
|
* @property int|null $updated_at
|
|
|
|
* @property int|null $deleted_at
|
|
|
|
* @property int $is_deleted
|
|
|
|
* @property string $color
|
|
|
|
* @property int|null $bank_category_id
|
|
|
|
* @property-read \App\Models\Expense|null $expense
|
|
|
|
* @property-read mixed $hashed_id
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel company()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns)
|
|
|
|
* @method static \Database\Factories\ExpenseCategoryFactory factory($count = null, $state = [])
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory filter(\App\Filters\QueryFilters $filters)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory newModelQuery()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory newQuery()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory onlyTrashed()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory query()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereBankCategoryId($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereColor($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereCompanyId($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereCreatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereDeletedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereId($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereIsDeleted($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereName($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereUpdatedAt($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory whereUserId($value)
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory withTrashed()
|
|
|
|
* @method static \Illuminate\Database\Eloquent\Builder|ExpenseCategory withoutTrashed()
|
|
|
|
* @mixin \Eloquent
|
|
|
|
*/
|
2020-01-20 02:31:58 +01:00
|
|
|
class ExpenseCategory extends BaseModel
|
|
|
|
{
|
|
|
|
use SoftDeletes;
|
2022-12-15 23:38:02 +01:00
|
|
|
use Filterable;
|
|
|
|
|
2020-01-20 02:31:58 +01:00
|
|
|
protected $fillable = [
|
|
|
|
'name',
|
2021-01-05 05:41:43 +01:00
|
|
|
'color',
|
2020-01-20 02:31:58 +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
|
|
|
}
|
|
|
|
|
2020-01-20 02:31:58 +01:00
|
|
|
/**
|
2020-10-28 11:10:49 +01:00
|
|
|
* @return BelongsTo
|
2020-01-20 02:31:58 +01:00
|
|
|
*/
|
|
|
|
public function expense()
|
|
|
|
{
|
2020-10-28 11:10:49 +01:00
|
|
|
return $this->belongsTo(Expense::class);
|
2020-01-20 02:31:58 +01:00
|
|
|
}
|
|
|
|
}
|