for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* GitScrum v0.1.
*
* @author Renato Marinho <[email protected]>
* @license http://opensource.org/licenses/GPL-3.0 GPLv3
*/
namespace GitScrum\Models;
use Illuminate\Database\Eloquent\Model;
use GitScrum\Scopes\GlobalScope;
class Favorite extends Model
{
use GlobalScope;
* The database table used by the model.
* @var string
protected $table = 'favorites';
* Attributes that should be mass-assignable.
* @var array
protected $fillable = ['favoriteable_type', 'favoriteable_id', 'user_id'];
protected static function boot()
parent::boot();
}
public function favoriteable()
return $this->morphTo('favoriteable');
public function user()
return $this->belongsTo(\GitScrum\Models\User::class, 'user_id', 'id');