base commit
This commit is contained in:
39
app/Models/Gift.php
Normal file
39
app/Models/Gift.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Concerns\LogsHrActivity;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Gift extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use LogsHrActivity;
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'employee_id',
|
||||
'gift_date',
|
||||
'gift_name',
|
||||
'value',
|
||||
'reason',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'gift_date' => 'date',
|
||||
'value' => 'decimal:2',
|
||||
];
|
||||
}
|
||||
|
||||
public function employee(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Employee::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user