Skip to content

amdad121/record-activity-laravel

Repository files navigation

User activity for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

created by, updated by and deleted by added on model of your Laravel.

Installation

You can install the package via composer:

composer require amdad121/record-activity-laravel

Usage

Open your migration file and add this table column. both are optional.

Schema::create('users', function (Blueprint $table) {
    // ...
    $table->withCreatedByAndUpdatedBy();
    $table->withDeletedBy();
});

Now this traits add on your model and add fillable property.

<?php

namespace App\Models;

use AmdadulHaq\RecordActivity\RecordActivity;
// ...

class User extends Model
{
    use CreatedByAndUpdatedBy, DeletedBy;

    protected $fillable = [
        // ...
        'created_by',
        'updated_by',
        'deleted_by',
    ];
}

Now run the migrations with this command.

php artisan migrate

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages