📌  相关文章
📜  检查图像是否存在于 laravel - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:22.387000             🧑  作者: Mango

代码示例3
// User Model
public function photo()
{
    if (file_exists( public_path() . '/images/photos/account/' . $this->account_id . '.png')) {
        return '/images/photos/account/' . $this->account_id .'.png';
    } else {
        return '/images/photos/account/default.png';
    }     
}

// Blade Template