hexathos/laravel-hasuserdata

Autofills updated_by, created_by, updated_at and created_at

v0.1.0 2022-09-30 11:52 UTC

This package is auto-updated.

Last update: 2024-03-29 04:52:18 UTC


README

About

This package automaticly adds username to models that have the Hexathos\Traits\HasUserData trait while creating or updating a Model.

It requires string-able fields "created_by" and "updated_by" in your database.

How to install

Require the package:

$ composer require hexathos/laravel-hasuserdata

Create a migration that adds created_by and updated_by fields to your models table

Include the Namespace in your Model and add the trait

namespace App\Models;

use Hexathos\Traits\HasUserData;

/* .snipped. */

use HasUserData;

That's it.