本文整理汇总了PHP中app\Posts::getFromDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Posts::getFromDate方法的具体用法?PHP Posts::getFromDate怎么用?PHP Posts::getFromDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Posts
的用法示例。
在下文中一共展示了Posts::getFromDate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$admin_messages = \App\AdminMessages::where('read', '=', 0);
$data = array('active_nav' => $this->active_nav, 'total_users' => \App\User::all()->count(), 'logged_in' => \App\User::where('logged_in', '=', 1)->count(), 'total_categories' => \App\categories::count(), 'total_posts' => \App\Posts::all()->count(), 'latest_users' => \App\User::orderBy('created_at', 'ASC')->limit(10)->get(), 'latest_posts' => \App\Posts::orderBy('created_at', 'ASC')->limit(10)->get(), 'unread_admin_messages' => $admin_messages->count(), 'new_users_month' => \App\User::getFromDate(date('y-m-0'))->count(), 'new_users_week' => \App\User::getFromDate(date('y-m-d', strtotime('-7 day')))->count(), 'new_users_day' => \App\User::getFromDate(date('y-m-d', strtotime('-1 day')))->count(), 'new_posts_month' => \App\Posts::getFromDate(date('y-m-0'))->count(), 'new_posts_week' => \App\Posts::getFromDate(date('y-m-d', strtotime('-7 day')))->count(), 'new_posts_day' => \App\Posts::getFromDate(date('y-m-d', strtotime('-1 day')))->count(), 'admin_messages' => $admin_messages->get());
return view('includes/admin/home')->with($data);
}