Skip to content

Handle visibility state on your Laravel Eloquent model records.

License

Notifications You must be signed in to change notification settings

neuecommerce/visible-records

Repository files navigation

Visible Records for Laravel

GitHub Tests Action Status GitHub Code Analysis Action Status Software License Latest Version on Packagist Total Downloads

An Activity Logger for Laravel Eloquent models.

Installation

  1. Install the package via Composer:
composer require neuecommerce/visible-records

Implementation

Automatic

Implementing the Visible Records package on your Eloquent models, is quite simple and can be done in 3 just simple steps:

  1. Implement the NeueCommerce\VisibleRecords\HasVisibilityInterface interface on your model(s).

  2. Implement the NeueCommerce\VisibleRecords\HasVisibility trait on your model(s).

  3. Create a database migration that adds the visibile_at nullable timestamp column to your model(s) table.

Here's an example of a model with the proper implementation:

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use NeueCommerce\VisibleRecords\HasVisibilityInterface;
use NeueCommerce\VisibleRecords\HasVisibility;

class Product extends Model implements HasVisibilityInterface
{
    use HasVisibility;

    public $table = 'products';
}

Here's an example of a database migration:

<?php

...

Usage

...

Testing

composer test

Contributing

Thank you for your interest. Here are some of the many ways to contribute.

License

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

About

Handle visibility state on your Laravel Eloquent model records.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages