LaravelPackages.net
Acme Inc.
Toggle sidebar
coreproc/nova-auditing-user-fields

A Laravel Nova field that works with the Laravel Auditing package to see who created or last updated a resource.

111.573
10
0.2.0
About coreproc/nova-auditing-user-fields

coreproc/nova-auditing-user-fields is a Laravel package for a laravel nova field that works with the laravel auditing package to see who created or last updated a resource.. It currently has 10 GitHub stars and 111.573 downloads on Packagist (latest version 0.2.0). Install it with composer require coreproc/nova-auditing-user-fields. Discover more Laravel packages by coreproc or browse all Laravel packages to compare alternatives.

Last updated

Nova Auditing User Fields

Latest Version on Packagist Total Downloads

A Laravel Nova field that works with the Laravel Auditing package to see who created or last updated a resource.

nova auditing user fields screenshot

Installation

You can install the package in to a Laravel app that uses Laravel Nova and the Laravel Auditing package via composer:

composer require coreproc/nova-auditing-user-fields

Usage

Once installed, you can begin using the CreatedBy and UpdatedBy fields inside a resource.

Please take note that the model of the resource should be using the Auditable trait and implements the Auditable contract as explained in the Laravel Auditing package: http://laravel-auditing.com/docs/8.0/model-setup.

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use OwenIt\Auditing\Contracts\Auditable;

class User extends Model implements Auditable
{
    use \OwenIt\Auditing\Auditable;

    // ...
}

And in your resource:

<?php

use Coreproc\NovaAuditingUserFields\CreatedBy;
use Coreproc\NovaAuditingUserFields\UpdatedBy;
use Illuminate\Http\Request;

class User extends Resource
{
    // ...
    
    public function fields(Request $request)
    {
        return [
            // ...
            
            CreatedBy::make('Created By'),
            
            UpdatedBy::make('Updated By')->onlyOnDetail(),
            
            // ...
        ];
    }
}

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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

Star History Chart