1. Go to this page and download the library: Download phpcollective/tracker library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
Schema::create('table', function (Blueprint $table) {
...
$table->track();
});
// To drop columns
Schema::table('table', function (Blueprint $table) {
$table->dropTrack();
});
Schema::create('table', function (Blueprint $table) {
...
$table->softDeletes();
$table->track(true);
});
// To drop columns with soft delete
Schema::table('table', function (Blueprint $table) {
$table->dropTrack(true);
});
namespace App;
use PhpCollective\Tracker\Trackable;
use Illuminate\Database\Eloquent\Model;
class Foo extends Model
{
use Trackable;
...
}
$foo = App\Foo::first();
$foo->creator;
$foo->editor;
// If your model use soft delete
$foo->destroyer;
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.