Files
jobifygarden/app/Models/JobCategory.php
T

33 lines
617 B
PHP
Raw Normal View History

2026-04-03 00:23:01 +03:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
class JobCategory extends Model
{
protected $fillable = [
'name',
'slug',
'description',
'icon',
];
/**
* Get the jobs for this category.
*/
public function jobs(): HasMany
{
return $this->hasMany(Job::class, 'job_category_id');
}
/**
* Get the job alerts for this category.
*/
public function jobAlerts(): HasMany
{
return $this->hasMany(UserJobAlert::class, 'job_category_id');
}
}