26 lines
570 B
PHP
26 lines
570 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Work extends Model
|
|
{
|
|
use HasFactory, SoftDeletes;
|
|
protected $fillable = [
|
|
"category_id", "name", "desc", "shortname"
|
|
];
|
|
|
|
/**
|
|
* Get all of the transactions for the Work
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
*/
|
|
public function transactions()
|
|
{
|
|
return $this->hasMany(Transaction::class, 'work_id', 'id');
|
|
}
|
|
}
|