Update RequestLog.php
Truncate URL which should be maximum 255 lenght. Reason: Today I got this error: ``` Next exception 'Illuminate\Database\QueryException' with message 'SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'url' at row 1 (SQL: insert into `system_request_logs` (`url`, `status_code`, `count`, `updated_at`, `created_at`) values (http://www.mysite.com/docs/%C3%83%C6%92%...<too-many-chars>...%80%9A%C3%82%C2%814.pdf, 404, 1, 2016-01-02 12:16:08, 2016-01-02 12:16:08)) ```
This commit is contained in:
parent
5a70cec7a2
commit
c6113f81bd
|
|
@ -36,7 +36,7 @@ class RequestLog extends Model
|
|||
if (!DbDongle::hasDatabase()) return;
|
||||
|
||||
$record = static::firstOrNew([
|
||||
'url' => Request::fullUrl(),
|
||||
'url' => substr(Request::fullUrl(), 0, 255),
|
||||
'status_code' => $statusCode,
|
||||
]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue