Custom user fields during registration and profile edit #711
This commit is contained in:
37
app/Models/UserFieldValue.php
Normal file
37
app/Models/UserFieldValue.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Contracts\Model;
|
||||
|
||||
/**
|
||||
* @property string name
|
||||
* @property string value
|
||||
* @property UserField field
|
||||
* @property User user
|
||||
*/
|
||||
class UserFieldValue extends Model
|
||||
{
|
||||
public $table = 'user_field_values';
|
||||
|
||||
protected $fillable = [
|
||||
'user_field_id',
|
||||
'user_id',
|
||||
'value',
|
||||
];
|
||||
|
||||
public static $rules = [];
|
||||
|
||||
/**
|
||||
* Foreign Keys
|
||||
*/
|
||||
public function field()
|
||||
{
|
||||
return $this->belongsTo(UserField::class, 'user_field_id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user