首先,我对拉威尔不太熟悉(或者对"脏"这个词不太熟悉)

if ($this->isDirty('status')) {
    if (Notification::has('website-status-' . strtolower($this->status))) {
        Notification::set($this->account, 'website-status-' . strtolower($this->status), $this->emailAttributes())
            ->email();
    }
}

And I couldn't understand what that means exactly. I tried to find out on the internet but the Laravel site only says this

"Determine if a given attribute is dirty"

这真的没用...

推荐答案

When you want to know if the model has been edited since it was queried from the database, or isn't saved at all, then you use the ->isDirty() function.

Laravel相关问答推荐

从8.0更新到10.0后,图像不再上传到存储

CKEditor在laravel中的p标记之前和之后添加额外的p标记

如何在数据来自Rest API的flutter中创建下拉类别名称列表?

如何获得每种类型的总和

Laravel Homestead vagrant up 超时

为什么命令php artisan serve不起作用

用户''@'localhost'对数据库'forge'的访问被拒绝随机出现

如何在laravel中将数组转换为字符串?

Laravel - 加载常见的页眉和页脚以查看

Laravel 5表单请求验证返回禁止错误

file_put_content ...无法打开流:Laravel 5 中的权限被拒绝

将 hasOne 模型附加到另一个 Laravel/Eloquent 模型而不指定 id

用于集合的 Laravel 5.5 API 资源

将 Laravel 集合附加到另一个集合

Laravel hasManyThrough

Lumen/Laravel 6:调用未定义的函数 array_except()

Laravel:array_merge():参数#2不是数组错误

Laravel 手动登录功能

在哪里放置 Blade::extend

如何在 laravel eloquent 中保存布尔值