写一个laravel项目,需求是将CURD的记录写入mysql的log表中,
我现在的方案就是CURD结束后自己写的LOG repository 记录一下 ,如下,
$result = $this->customer->add($request->all());
if($result>0){
$this->log->write('新增客户'.$request->input('name'));
}
觉得很不优雅,大家有什么好的思路吗
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
光阴似箭催人老,日月如移越少年。