diff options
author | Camil Staps | 2018-06-26 23:18:58 +0200 |
---|---|---|
committer | Camil Staps | 2018-06-26 23:18:58 +0200 |
commit | 18772a01928fdd6410626d13bba1b0a82c1c2842 (patch) | |
tree | 71d0fbdfb45d373aadda45b22d51a88964e16cbf | |
parent | Add CSRF tokens to views (diff) |
Don't store CSRF _token in logs
-rw-r--r-- | app/RandomLog.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/RandomLog.php b/app/RandomLog.php index a90018c..f0fefb9 100644 --- a/app/RandomLog.php +++ b/app/RandomLog.php @@ -26,10 +26,17 @@ class RandomLog extends Model { public $timestamps = false; protected $fillable = ['request', 'response']; - public static function boot() { + public static function boot() { static::creating(function ($model) { $model->created_at = $model->freshTimestamp(); }); } + public function setRequestAttribute($value) { + $value = json_decode($value, true); + unset($value['_token']); + $value = json_encode($value); + $this->attributes['request'] = $value; + } + } |