class User extends Authenticatable
{
protected $fillable = [
'name',
'email',
'password',
'patch_no'
];
//....
//....
public function patch(): BelongsTo
{
return $this->belongsTo(Patch::class);
}
}
class Patch extends Model
{
use HasFactory;
protected $fillable = ['code'];
public function users(): HasMany
{
return $this->hasMany(User::class);
}
}
class User extends Authenticatable
{
protected $fillable = [
'name',
'email',
'password',
'patch_no'
];
//....
//....
public function patch(): BelongsTo
{
return $this->belongsTo(Patch::class);
}
}
class Patch extends Model
{
use HasFactory;
protected $fillable = ['code'];
public function users(): HasMany
{
return $this->hasMany(User::class);
}
}