inital commit
This commit is contained in:
33
app/Models/RandDVoting.php
Normal file
33
app/Models/RandDVoting.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RandDVoting extends Model
|
||||
{
|
||||
protected $table = 'randd_votings';
|
||||
|
||||
protected $fillable = [
|
||||
'project_id',
|
||||
'description',
|
||||
'user_id',
|
||||
'status',
|
||||
];
|
||||
/// relation one to many between Project(NewRandD) and Voting
|
||||
public function project()
|
||||
{
|
||||
return $this->belongsTo(NewRandD::class, 'project_id', 'id');
|
||||
}
|
||||
|
||||
/// Relation one to many between user and voting
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function answers()
|
||||
{
|
||||
return $this->hasMany(RandDVotingPaperAnswer::class, 'vote_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user