本文整理汇总了PHP中app\Image::pastperiod方法的典型用法代码示例。如果您正苦于以下问题:PHP Image::pastperiod方法的具体用法?PHP Image::pastperiod怎么用?PHP Image::pastperiod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Image
的用法示例。
在下文中一共展示了Image::pastperiod方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAll
public function getAll()
{
$period = new Period();
$current_period = $period->active()->first();
$img = new Image();
$periods = $period->all();
$winners = [];
$pp_images = !is_null($current_period) ? $img->pastperiod($current_period)->get() : null;
$rules = ['Hi everyone! Welcome to the Zeal Optics Ski Goggles Game!', 'The game goes on for 4 periods.', 'The photo with the most votes wins!', 'Every period a new winner is selected!', 'The rules are simple: register, post the most amazing and unique photo from your last ski vacation.', 'Sit back, relax and wait until the end of the period!', 'After every period the winners will be published on this page.', 'You can only post once!', 'You can als vote, but also only once for each photo!'];
$past_periods = $period->past()->get();
if ($past_periods) {
foreach ($past_periods as $key => $p) {
$winners['Period ' . ($key + 1)] = Votes::winners($p);
}
}
$images = $current_period != null ? $img->with('author')->active($current_period)->get() : null;
return view('home', compact('images', 'winners', 'rules', 'pp_images', 'periods'));
}