From 520b977a27d016a84cb105035a173d64e4629b40 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 10 May 2016 23:27:22 +0200 Subject: Added logging of random requests --- app/RandomLog.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 app/RandomLog.php (limited to 'app/RandomLog.php') diff --git a/app/RandomLog.php b/app/RandomLog.php new file mode 100644 index 0000000..a90018c --- /dev/null +++ b/app/RandomLog.php @@ -0,0 +1,35 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +namespace HebrewParseTrainer; + +use Illuminate\Database\Eloquent\Model; + +class RandomLog extends Model { + + protected $table = 'random_logs'; + public $timestamps = false; + protected $fillable = ['request', 'response']; + + public static function boot() { + static::creating(function ($model) { + $model->created_at = $model->freshTimestamp(); + }); + } + +} -- cgit v1.2.3