Snapshot of main at 9f39a6e1e (2026-11-02)
This commit is contained in:
commit
6ccf1792d7
2580 files changed
+1040202
No files matched your search
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PollResponse extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = ['poll_id', 'voter_id', 'voter_type', 'user_id', 'dedupe_key', 'ledger_sequence', 'submitted_at'];
|
||||
|
||||
protected $casts = [
|
||||
'submitted_at' => 'datetime',
|
||||
'ledger_sequence' => 'integer',
|
||||
];
|
||||
|
||||
|
||||
public function poll()
|
||||
{
|
||||
return $this->belongsTo(Poll::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* The active profile that voted (user, organization, bank or admin).
|
||||
*/
|
||||
public function voter()
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
/**
|
||||
* The user behind the voting profile.
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function answers()
|
||||
{
|
||||
return $this->hasMany(PollAnswer::class);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user