amdad121/record-activity-laravel

v1.0.2 2023-12-31 18:45 UTC

This package is auto-updated.

Last update: 2024-04-30 00:36:27 UTC


README

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.