Looking to hire Laravel developers? Try LaraJobs

laravel-hasuserdata maintained by hexathos

Description
Autofills updated_by, created_by, updated_at and created_at
Author
Last update
2022/09/30 13:52 (dev-main)
License
Links
Downloads
207

Comments
comments powered by Disqus

Laravel-HasUserData

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.