Recommend this page to a friend! |
![]() ![]() |
Info | ![]() |
![]() |
![]() ![]() |
Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2021-04-29 (4 months ago) ![]() | Not yet rated by the users | Total: 15 | All time: 10,383 This week: 259![]() |
Version | License | PHP version | Categories | |||
laravel-auditable 1.0 | MIT/X Consortium ... | 5 | PHP 5, Databases, Libraries, Design P... |
Description | Author | |
This package can be used to track the users that make changes to model objects in Laravel applications. |
|
<p align="center"><a href="https://pharaonic.io" target="_blank"><img src="https://raw.githubusercontent.com/Pharaonic/logos/main/auditable.jpg" width="470"></a></p>
<p align="center"> <a href="https://github.com/Pharaonic/laravel-auditable" target="_blank"><img src="http://img.shields.io/badge/source-pharaonic/laravel--auditable-blue.svg?style=flat-square" alt="Source"></a> <a href="https://packagist.org/packages/pharaonic/laravel-auditable" target="_blank"><img src="https://img.shields.io/packagist/v/pharaonic/laravel-auditable?style=flat-square" alt="Packagist Version"></a><br> <a href="https://laravel.com" target="_blank"><img src="https://img.shields.io/badge/Laravel->=6.0-red.svg?style=flat-square" alt="Laravel"></a> <img src="https://img.shields.io/packagist/dt/pharaonic/laravel-auditable?style=flat-square" alt="Packagist Downloads"> <img src="http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square" alt="Source"> </p>
<h1 align="center">Laravel Auditable</h1>
Install the latest version using Composer:
$ composer require pharaonic/laravel-auditable
<br>
<a name="CS"></a>
// created_by, created_at
// updated_by, updated_at
$table->auditable();
// created_by, created_at
// updated_by, updated_at
// deleted_by, deleted_at
$table->auditableWithSoftDeletes();
<br>
<a name="US"></a>
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Pharaonic\Laravel\Audits\Auditable;
class Article extends Model
{
use Auditable;
}
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Pharaonic\Laravel\Audits\Auditable;
class Article extends Model
{
use Auditable;
use SoftDeletes;
}
<br>
<a name="HTU"></a>
// Creating
$article = Article::create(['title' => 'Moamen Eltouny']);
echo $article->created_at->isoFormat('LLLL');
echo $article->created_by->name;
// Updating
$article = Article::first();
echo $article->updated_at->isoFormat('LLLL');
echo $article->updated_by->name;
// Deleting (ONLY WITH SoftDeletes)
$article->delete();
$article = Article::withTrashed()->first();
echo $article->deleted_at->isoFormat('LLLL');
echo $article->deleted_at->name;
<br><br>
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Lic. | License text | ||
![]() ![]() |
Doc. | Read me |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.