33 lines
617 B
PHP
33 lines
617 B
PHP
<?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');
|
|
}
|
|
}
|