I have a web site that has a really big form that is stored across many different models. I wanted to implement model history, so I could know which user modified one of these models. I started using VentureCraft's "Revisionable" (http://ift.tt/MGRljz), as they already use this.
I configured everything as the documentation says, but the only change that is recorded in my model is the "created" one. If I modify any field other field, the changes are not stored on the "revisions" table in my database.
Here's my model that uses the trait:
namespace sonda\Models\RFC;
use Illuminate\Database\Eloquent\Model;
use Venturecraft\Revisionable\RevisionableTrait as RevisionableTrait;
class Rfc extends Model
{
use RevisionableTrait;
public static function boot()
{
parent::boot();
}
protected $revisionEnabled = true;
protected $revisionCreationsEnabled = true;
protected $keepRevisionOf = array(
'client'
);
protected $guarded = [
'id'
];
public function areaParticipants()
{
return $this->hasMany('App\Models\RFC\AreaParticipant');
}
public function involvedMachines()
{
return $this->hasMany('App\Models\RFC\InvolvedMachine');
}
public function areaNotifys()
{
return $this->hasMany('App\Models\RFC\AreaNotify');
}
}
You can see here: http://ift.tt/1FOnK2g that it is not entirely broken, as the create method is being called and stored in the database. Still, any update or edit is not being kept.
Any ideas?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire