在 Laravel 模型事件中阻止事件处理的方法
<https://laravel.com/docs/11.x/eloquent muting events 非常简单,在 withoutEvents 中使用时,不会触发相当于 boot() 的模型触发器。 另外,保存时使用 ,同样可以避免保存时触发模型触发器。
GGAMI
https://laravel.com/docs/11.x/eloquent#muting-events
use App\Models\User;
$user = User::withoutEvents(function (