A simple Laravel package for Eloquent Model user specific fields.
fnematov/laravel-userstamps is a Laravel package for a simple laravel package for eloquent model user specific fields..
It currently has 2 GitHub stars and 60 downloads on Packagist (latest version v1.5).
Install it with composer require fnematov/laravel-userstamps.
Discover more Laravel packages by fnematov
or browse all Laravel packages to compare alternatives.
Last updated
Laravel Userstamps is a simple Laravel package for your Eloquent Model user specific fields. This package automatically inserts/updates an user id on your table on who created, last updated and deleted the record.
composer require fnematov/laravel-userstamps
Update your model's migration and add created_by, updated_by and deleted_by field using the userstamps() blueprint macro.
Schema::create('users', function (Blueprint $table) {
$table->userstamps();
});
Then use UserstampsTrait on your model.
namespace App;
use Fnematov\Userstamps\UserstampsTrait;
class User extends Model
{
use UserstampsTrait;
}
You can drop auditable columns using dropUserstamps() method.
Schema::create('users', function (Blueprint $table) {
$table->dropUserstamps();
});
And your done!
The MIT License (MIT). Please see License File for more information.