phase 1 and 2
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user