country + status added and other changes
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Country extends Model
|
||||
{
|
||||
protected $fillable = ['title', 'country_flag', 'status'];
|
||||
|
||||
public function registrations()
|
||||
{
|
||||
return $this->hasMany(Registration::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ class Registration extends Model
|
||||
'name',
|
||||
'email',
|
||||
'phone',
|
||||
'country_id',
|
||||
'status',
|
||||
'total_score',
|
||||
];
|
||||
|
||||
@@ -31,6 +33,11 @@ class Registration extends Model
|
||||
return $this->hasMany(Comment::class);
|
||||
}
|
||||
|
||||
public function country()
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Country::class);
|
||||
}
|
||||
|
||||
/*
|
||||
|---------------------------
|
||||
| Helper methods
|
||||
|
||||
Reference in New Issue
Block a user