for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Yoeunes\Voteable\Models;
use Illuminate\Database\Eloquent\Model;
class Vote extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'amount',
'user_id',
'voteable_id',
'voteable_type',
];
* @return \Illuminate\Database\Eloquent\Relations\MorphTo
public function voteable()
return $this->morphTo();
}
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
public function user()
return $this->belongsTo(config('voteable.user'));