for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace RichanFongdasen\EloquentBlameable;
use Illuminate\Database\Eloquent\Model;
class BlameableObserver
{
/**
* Listening to any creating events.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @return void
*/
public function creating(Model $model)
app(BlameableService::class)->setAttribute($model, 'createdBy');
}
* Listening to any deleting events.
public function deleting(Model $model)
app(BlameableService::class)->setAttribute($model, 'deletedBy');
if ($model->isDirty()) {
$model->silentUpdate();
silentUpdate()
Illuminate\Database\Eloquent\Model
update()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
* Listening to any restoring events.
public function restoring(Model $model)
app(BlameableService::class)->setAttribute($model, 'deletedBy', true);
* Listening to any saving events.
public function saving(Model $model)
app(BlameableService::class)->setAttribute($model, 'updatedBy');
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.