fixed models
This commit is contained in:
parent
f9ce7d540c
commit
ef5656cf04
3 changed files with 36 additions and 3 deletions
16
app/Models/Employer.php
Normal file
16
app/Models/Employer.php
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Employer extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
public function jobs()
|
||||
{
|
||||
return $this->hasMany(Job::class);
|
||||
}
|
||||
}
|
18
app/Models/Rating.php
Normal file
18
app/Models/Rating.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Rating extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = ['score'];
|
||||
|
||||
public function jobs()
|
||||
{
|
||||
return $this->belongsToMany(Job::class, relatedPivotKey: 'job_listing_id');
|
||||
}
|
||||
}
|
|
@ -9,13 +9,12 @@ use Illuminate\Notifications\Notifiable;
|
|||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
/** @use HasFactory<\Database\Factories\UserFactory> */
|
||||
use HasFactory, Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name',
|
||||
|
@ -26,7 +25,7 @@ class User extends Authenticatable
|
|||
/**
|
||||
* The attributes that should be hidden for serialization.
|
||||
*
|
||||
* @var list<string>
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
|
|
Loading…
Add table
Reference in a new issue