📜  laravel orm latest() - PHP 代码示例

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

代码示例1
latest() is a function defined in Illuminate\Database\Query\Builder Class. It's job is very simple. This is how it is defined.
public function latest($column = 'created_at')
{
    return $this->orderBy($column, 'desc');
} 
So, It will just orderBy with the column you provide in descending order with the default column will be created_at.