From bac7e05d6f34904e7a2f0f635305376310be8f12 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 12 Jul 2018 10:36:20 -0600 Subject: [PATCH] Add AccountLog model/migration --- app/{Report.php => AccountLog.php} | 2 +- ...07_05_010303_create_account_logs_table.php | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) rename app/{Report.php => AccountLog.php} (70%) create mode 100644 database/migrations/2018_07_05_010303_create_account_logs_table.php diff --git a/app/Report.php b/app/AccountLog.php similarity index 70% rename from app/Report.php rename to app/AccountLog.php index a57f84ac..f5ccedd9 100644 --- a/app/Report.php +++ b/app/AccountLog.php @@ -4,7 +4,7 @@ namespace App; use Illuminate\Database\Eloquent\Model; -class Report extends Model +class AccountLog extends Model { // } diff --git a/database/migrations/2018_07_05_010303_create_account_logs_table.php b/database/migrations/2018_07_05_010303_create_account_logs_table.php new file mode 100644 index 00000000..1d200733 --- /dev/null +++ b/database/migrations/2018_07_05_010303_create_account_logs_table.php @@ -0,0 +1,40 @@ +bigIncrements('id'); + $table->bigInteger('user_id')->unsigned()->index(); + $table->bigInteger('item_id')->unsigned()->nullable(); + $table->string('item_type')->nullable(); + $table->string('action')->nullable(); + $table->string('message')->nullable(); + $table->string('link')->nullable(); + $table->string('ip_address')->nullable(); + $table->string('user_agent')->nullable(); + $table->json('metadata')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('account_logs'); + } +}