Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当没有数据更改时,laravel 检查 isDirty 并且从不执行更新查询,因此不会触发模型更新事件。我们如何手动触发事件?
手动触发事件
$user = User::findOrFail($id); $user->fill($data); $user->save(); event('eloquent.updated: App\User', $user);