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 deleted events.
public function deleted(Model $model)
app(BlameableService::class)->setAttribute($model, 'deletedBy');
if ($model->useSoftDeletes()) {
useSoftDeletes()
Illuminate\Database\Eloquent\Model
delete()
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.
$model->silentUpdate();
silentUpdate()
update()
* 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.