本文整理匯總了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'));
}