📜  更新 onlu 一栏 laravel - PHP 代码示例

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

代码示例1
Page::where('id', $id)->update(array('image' => 'asdasd'));

// -----or-----

$page = Page::findOrFail($id);
// Make sure you've got the Page model
if($page) {
    $page->image = 'imagepath';
    $page->save();
}