Add support for base API logging of all requests

ref #31
This commit is contained in:
Dane Everitt 2016-10-07 16:06:09 -04:00
parent 0fe0f750c4
commit af68dbed8f
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 172 additions and 0 deletions

View file

@ -0,0 +1,39 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class BuildApiLogTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('api_logs', function (Blueprint $table) {
$table->increments('id');
$table->boolean('authorized');
$table->char('key', 16)->nullable();
$table->char('method', 6);
$table->text('route');
$table->text('content')->nullable();
$table->text('user_agent');
$table->ipAddress('request_ip');
$table->timestampsTz();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('api_logs');
}
}