<?php

namespace Rogue\Models;

use Illuminate\Database\Eloquent\Model;

class Event extends Model
{
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['eventable_id', 'eventable_type', 'content', 'user'];

    /**
     * Attributes that can be queried when filtering.
     *
     * This array is manually maintained. It does not necessarily mean that
     * any of these are actual indexes on the database... but they should be!
     *
     * @var array
     */
    public static $indexes = [
        'eventable_id',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'content' => 'array',
    ];

    public function eventable()
    {
        return $this->morphTo();
    }

    public function scopeForSignup($query, $id)
    {
        return $query->where('eventable_type', 'Rogue\Models\Signup')
                     ->where('eventable_id', $id);
    }
}

<?php

namespace Rogue\Models;

use Illuminate\Database\Eloquent\Model;

class Event extends Model
{
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['content', 'user'];

    /**
     * Attributes that can be queried when filtering.
     *
     * This array is manually maintained. It does not necessarily mean that
     * any of these are actual indexes on the database... but they should be!
     *
     * @var array
     */
    public static $indexes = [
        'eventable_id',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'content' => 'array',
    ];

    public function eventable()
    {
        return $this->morphTo();
    }

    public function scopeForSignup($query, $id)
    {
        return $query->where('eventable_type', 'Rogue\Models\Signup')
                     ->where('eventable_id', $id);
    }
}

Remove event attributes that should not be fillable.
Remove event attributes that should not be fillable.
