本文整理汇总了PHP中app\Comment::latest方法的典型用法代码示例。如果您正苦于以下问题:PHP Comment::latest方法的具体用法?PHP Comment::latest怎么用?PHP Comment::latest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Comment
的用法示例。
在下文中一共展示了Comment::latest方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
public function show($id)
{
$m = array(24, 28, 30, 47, 29, 73, 37, 46, 59, 60);
$k = array(9, 12, 55, 56, 40, 41, 93, 141, 85, 192);
$user = User::findOrFail($id);
$comments = Comment::latest('created_at')->paginate(20);
$commits = Commit::latest('created_at')->get();
return view('profile.show', compact('user', 'comments', 'commits', 'checkFriend', 'm', 'k'));
}
示例2: show
public function show($id)
{
if (!Auth::check()) {
return redirect('/');
}
$clanak = Article::findOrFail($id);
$komentari = Comment::latest('created_at')->where('article_id', '=', $id)->get();
return view('auth.komentari', compact('clanak', 'komentari'));
}
示例3: show
/**
* Display the specified resource.
*
* @return \Illuminate\Http\Response
*/
public function show()
{
$comments = Comment::latest()->get();
return view('comment', compact('comments'));
}
示例4: comments
public function comments()
{
$all_comments = Comment::latest()->paginate(20);
$current_form = 'comments';
return view('admin.comments', compact('all_comments', 'current_form'));
}
示例5: show
public function show($id)
{
$clanak = Article::findOrFail($id);
$komentari = Comment::latest('created_at')->where('article_id', '=', $id)->get();
return view('clanak.clanak', compact('clanak', 'komentari'));
}
示例6: show
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($category_slug, $slug)
{
$category = Category::where('slug', '=', $category_slug)->first();
$comments = Comment::latest()->paginate(15);
$post = Post::where('slug', '=', $slug)->first();
//$post_tags = PostTags::where('post_id', '=', $post->id)->get();
//User::find(1)->role->name;
$tags = Post::find($post->id)->tags;
return view('pages.posts.show', compact('post', $post, 'category', $category, 'comments', $comments, 'tags', $tags));
}
示例7: manageComment
public function manageComment()
{
$comments = Comment::latest('created_at')->get();
return view('admin.comment', compact('comments'));
}