如何验证输入的数据是否存在于 laravel 中的数据库中

How to verify that the entered data is present in the database in laravel

如何验证输入的数据是否存在于数据库中,如果不存在则返回错误信息

你可以使用 findOrFail($id)。文件:https://laravel.com/docs/9.x/eloquent#not-found-exceptions