本文整理汇总了PHP中Picture::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Picture::all方法的具体用法?PHP Picture::all怎么用?PHP Picture::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Picture
的用法示例。
在下文中一共展示了Picture::all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIndex
public function getIndex()
{
if (Auth::guest() || Auth::user()->isAdmin == 0) {
return Redirect::secure('/');
}
// layouts variables
$this->layout->title = 'Админ панел | Нещо Шантаво';
$this->layout->canonical = 'https://neshto.shantavo.com/admin/';
$this->layout->robots = 'noindex,nofollow,noodp,noydir';
$users = count(User::all());
$admins = count(User::where('isAdmin', ">", 0)->get());
$categories = count(Category::all());
$albums = count(Album::all());
$votes = count(DB::table('votes')->get());
$pictures = count(Picture::all());
$pictureSize = 0;
foreach (Picture::all() as $p) {
$pictureSize += $p->size;
}
// get disqus stats
include app_path() . '/config/_disqus.php';
$disqus = new DisqusAPI(getDisqusKey());
$disqus->setSecure(false);
$comments = $disqus->posts->list(array('forum' => 'shantavo'));
// nesting the view into the layout
$this->layout->nest('content', 'admin.index', array('users' => $users, 'admins' => $admins, 'votes' => $votes, 'categories' => $categories, 'albums' => $albums, 'pictures' => $pictures, 'pictureSize' => $pictureSize, 'comments' => $comments));
}
示例2:
<?php
View::share('title', "Exprime");
View::share('page_title', "");
View::share('website_keywords', "générateur de Memes mobile support, générateur de trolls mobile support\n images trolls pour commentaires de facebook, images Memes commentaires de facebook, images trolls marocaines,\n images trolls darija, images trolls arabe dialectal marocain, images Memes marocaines,\n images Memes darija, images Memes arabe dialectal marocain");
View::share('page_keywords', "");
if (starts_with(Request::path(), 'admin')) {
// dd(Session::all());
$pictures_count = Picture::all()->count();
$users_count = User::all()->count();
$emails_count = Email::all()->count();
$bugs_count = 0;
$sugs_count = 0;
$old_pictures_count = Session::get('old_pictures_count', $pictures_count);
$old_users_count = Session::get('old_users_count', $users_count);
$old_emails_count = Session::get('old_emails_count', $emails_count);
$old_bugs_count = Session::get('old_bugs_count', $bugs_count);
$old_sugs_count = Session::get('old_sugs_count', $sugs_count);
Session::set('old_pictures_count', $pictures_count);
Session::set('old_users_count', $users_count);
Session::set('old_emails_count', $emails_count);
Session::set('old_bugs_count', $bugs_count);
Session::set('old_sugs_count', $sugs_count);
$new_pictures = $pictures_count - $old_pictures_count;
$new_users = $users_count - $old_users_count;
$new_emails = $emails_count - $old_emails_count;
$new_bugs = $bugs_count - $old_bugs_count;
$new_sugs = $sugs_count - $old_sugs_count;
View::share('pictures_count', $pictures_count);
View::share('users_count', $users_count);
View::share('emails_count', $emails_count);