PHPackages                             jhonoryza/laravel-model-history - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. jhonoryza/laravel-model-history

ActiveLibrary[Database &amp; ORM](/categories/database)

jhonoryza/laravel-model-history
===============================

1.0.7(9mo ago)013MITPHPPHP ^8.1

Since Sep 11Pushed 9mo agoCompare

[ Source](https://github.com/jhonoryza/laravel-model-history)[ Packagist](https://packagist.org/packages/jhonoryza/laravel-model-history)[ RSS](/packages/jhonoryza-laravel-model-history/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (6)Versions (9)Used By (0)

Laravel Model History
=====================

[](#laravel-model-history)

[![Latest Stable Version](https://camo.githubusercontent.com/e7fd1e81ce7ddb0540f5058a5acb51e290b7a135b9f7d4a920db6c8295ad45a4/687474703a2f2f706f7365722e707567782e6f72672f6a686f6e6f72797a612f6c61726176656c2d6d6f64656c2d686973746f72792f76)](https://packagist.org/packages/jhonoryza/laravel-model-history)[![Total Downloads](https://camo.githubusercontent.com/80efa588eb58bacb1341f49a07439adde2c6817a2790a70432c026958e641cdc/687474703a2f2f706f7365722e707567782e6f72672f6a686f6e6f72797a612f6c61726176656c2d6d6f64656c2d686973746f72792f646f776e6c6f616473)](https://packagist.org/packages/jhonoryza/laravel-model-history)[![Latest Unstable Version](https://camo.githubusercontent.com/0cecb0d2199290c0e39b65a71489a8ec96065e1a87c4bf71fb1485111edfa18d/687474703a2f2f706f7365722e707567782e6f72672f6a686f6e6f72797a612f6c61726176656c2d6d6f64656c2d686973746f72792f762f756e737461626c65)](https://packagist.org/packages/jhonoryza/laravel-model-history)[![License](https://camo.githubusercontent.com/34367083011e47c086ea2585bfff50c9d194df1097e37ded3bede8e3b9e7ad17/687474703a2f2f706f7365722e707567782e6f72672f6a686f6e6f72797a612f6c61726176656c2d6d6f64656c2d686973746f72792f6c6963656e7365)](https://packagist.org/packages/jhonoryza/laravel-model-history)[![PHP Version Require](https://camo.githubusercontent.com/ef0c87e3a68ce868755ed35c3ef39b685a587263584a0ab3711c381cb0bbd09d/687474703a2f2f706f7365722e707567782e6f72672f6a686f6e6f72797a612f6c61726176656c2d6d6f64656c2d686973746f72792f726571756972652f706870)](https://packagist.org/packages/jhonoryza/laravel-model-history)

This package provides ability to generate `_logs` table from your model.

Requirement
-----------

[](#requirement)

- PHP 8.1 - 8.4
- Laravel 9, 10, 11, 12

Getting Started
---------------

[](#getting-started)

install

```
composer require jhonoryza/laravel-model-history
```

Usage
-----

[](#usage)

let's say you want to create table `category_logs`

we can achieve this with running this command:

```
php artisan model-history:generate categories
```

it will generate new migration for table `category_logs` and new model `CategoryLog`

then you can add to the log like this :

```
