ZHE
工具
AI命令
导航
博客
|
登录
注册
AI画图提示词
ubuntu
linux
web3
seo
laravel
wordpress
PHP
Stable Diffusion实战
Go语言教程之边写边学
Copyright zhe.ink ©2023-2025
Email: service@zhe.ink
吉ICP备2024017385号-3
苏公网安备 32050902101537号
laravel如何判断模型中是否有指定字段
2023-11-16 10:26:20
243
laravel
model
判断字段是否存在
比如,需要判断模型中是否有user_id字段,用以下方法即可。
Schema::hasColumn($this->model->getTable(), 'user_id')