Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/253.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 按日期查找上次创建的记录Laravel 5_Php_Laravel 5 - Fatal编程技术网

Php 按日期查找上次创建的记录Laravel 5

Php 按日期查找上次创建的记录Laravel 5,php,laravel-5,Php,Laravel 5,如何找到用户上次添加记录的时间并获取该记录 大概是这样的: Comment::where('user_id',Auth::id())->where(HERE I NEED TO GET BIGEST create_at)->first(); 对此有任何解决方案吗?使用orderby语句: Comment::where('user_id', Auth::id())->orderBy('created_at', 'desc')->first(); 见: 有关详细信息,请

如何找到用户上次添加记录的时间并获取该记录

大概是这样的:

Comment::where('user_id',Auth::id())->where(HERE I NEED TO GET BIGEST create_at)->first();

对此有任何解决方案吗?

使用orderby语句:

Comment::where('user_id', Auth::id())->orderBy('created_at', 'desc')->first();
见:


有关详细信息,请使用orderby语句:

Comment::where('user_id', Auth::id())->orderBy('created_at', 'desc')->first();
见:


有关详细信息,请使用orderby语句:

Comment::where('user_id', Auth::id())->orderBy('created_at', 'desc')->first();
见:


有关详细信息,请使用orderby语句:

Comment::where('user_id', Auth::id())->orderBy('created_at', 'desc')->first();
见:

更多信息