【发布时间】:2021-07-13 16:00:48
【问题描述】:
我正在使用 laravel 审计,它在 UUID 上显示错误我认为,我已经从 http://www.laravel-auditing.com/docs/9.0/installation 安装并配置了 laravel 审计,并将 user_id 和 id 更改为默认类型为 bigInteger 的 UUID
public function up()
{
Schema::create('audits', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('user_type')->nullable();
$table->uuid('user_id')->nullable();
$table->string('event');
$table->morphs('auditable');
$table->text('old_values')->nullable();
$table->text('new_values')->nullable();
$table->text('url')->nullable();
$table->ipAddress('ip_address')->nullable();
$table->string('user_agent', 1023)->nullable();
$table->string('tags')->nullable();
$table->timestamps();
});
}
我还在 audit.php 中使用 UUIDs Trait,就像在我的其他项目模型中所做的那样
SQLSTATE[22P02]:无效文本表示:7 错误:无效输入 bigint 类型的语法:“974afba9-556e-4ecd-bd42-aaf12ce9aab0”(SQL: 插入“审计”(“旧值”、“新值”、“事件”、 “auditable_id”、“auditable_type”、“user_id”、“user_type”、“url”、 “ip_address”、“user_agent”、“tags”、“id”、“updated_at”、“created_at”) values ([], {"title":"Magnam nulla perfere","code":"Temporibus in ut cul","created_by":"2d03731c-9c71-4238-bdfc-03e3f556ddef","end_date":"2012-09-29","start_date":"2016-12-02","currency":"PKR" “状态”:“进行中”,“预算”:“32”,“目标”:“建筑师” adipisci","具体目标":"Eveniet Harum repre","abreviation":"Aut iusto quod quia","pcr_deadline":"1976-04-28","donor":"UNICEF","donor_fp_name":"Tanner Noble","donor_fp_email":"gyvimyz@mailinator.com","donor_fp_designation":"Ut vel quidem sed fa","donor_fp_mobile":"请坐 提供者","donor_fp_phone_office":"+1 (832) 163-8003","brsp_fp_email":"wygihihyw@mailinator.com","brsp_fp_name":"迈尔斯 卡梅伦","brsp_fp_designation":"Laboris ut eius ut e","brsp_fp_mobile":"Doloribus quis possi","brsp_fp_phone_office":"+1 (891) 256-8645","reporting_frequency":"每月","id":"974afba9-556e-4ecd-bd42-aaf12ce9aab0","updated_at":"2021-07-13 15:32:09","created_at":"2021-07-13 15:32:09"}, 创建, 974afba9-556e-4ecd-bd42-aaf12ce9aab0,应用\模型\项目, 2d03731c-9c71-4238-bdfc-03e3f556ddef,应用\模型\用户, http://localhost:8000/project/store, 127.0.0.1, Mozilla/5.0 (Windows 新台币 10.0; WIN64; x64) AppleWebKit/537.36 (KHTML, 像 Gecko) Chrome/91.0.4472.124 Safari/537.36, ?, eda36c0b-13c3-42c1-a345-fe2bb4b27520, 2021-07-13 15:32:09, 2021-07-13 15:32:09))
【问题讨论】:
标签: php laravel logging eloquent laravel-auditing