mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-03 08:50:22 -05:00
(Update) Cleanup Voter Model
This commit is contained in:
+17
-3
@@ -16,21 +16,35 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Voter extends Model
|
||||
{
|
||||
|
||||
/**
|
||||
* The Attributes That Are Mass Assignable
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'poll_id',
|
||||
'user_id',
|
||||
'ip_address'
|
||||
];
|
||||
|
||||
/**
|
||||
* Belongs To A Poll
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function poll()
|
||||
{
|
||||
return $this->belongsTo(\App\Poll::class);
|
||||
return $this->belongsTo(Poll::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Belongs To A User
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(\App\User::class)->withDefault([
|
||||
return $this->belongsTo(User::class)->withDefault([
|
||||
'username' => 'System',
|
||||
'id' => '1'
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user