本文整理汇总了PHP中app\Posts::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Posts::get方法的具体用法?PHP Posts::get怎么用?PHP Posts::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Posts
的用法示例。
在下文中一共展示了Posts::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: allPosts
public function allPosts(Request $request)
{
$posts = Posts::get();
return $posts;
}
示例2: function
});
/**
* API
*/
Route::get('api/users', ['middleware' => 'cors', function () {
return \Response::json(\App\User::get(), 200);
}]);
Route::get('api/markers', ['middleware' => 'cors', function () {
return \Response::json(\App\Mark::get(), 200);
}]);
Route::post('api/markers', ['middleware' => 'cors', function () {
return \Response::json(\App\Mark::get(), 200);
}]);
Route::get('api/contributors', ['middleware' => 'cors', function () {
return \Response::json(\App\Contributor::get(), 200);
}]);
Route::get('api/posts', ['middleware' => 'cors', function () {
return \Response::json(\App\Posts::get(), 200);
}]);
Route::get('api/news', ['middleware' => 'cors', function () {
return \Response::json(\App\Posts::get(), 200);
}]);
Route::post('oauth/access_token', function () {
return Response::json(Authorizer::issueAccessToken());
});
Route::get('email', function () {
Mail::raw('Novo voluntário cadastrado', function ($m) {
$m->to('mariliasemdengue@marilia.sp.gov.br', 'Marilia sem Dengue')->bcc('faq@sotaquepropaganda.com.br', 'Marilia sem Dengue')->subject('Novo voluntário cadastrado no site');
});
return \Redirect::to('/home');
});
示例3: array
break;
case "delete":
if (!Permission::sufficient('staff')) {
Response::fail();
}
if (!$Database->whereEp($Episode)->delete('episodes')) {
Response::dbError();
}
Logs::action('episodes', array('action' => 'del', 'season' => $Episode->season, 'episode' => $Episode->episode, 'twoparter' => $Episode->twoparter, 'title' => $Episode->title, 'airs' => $Episode->airs));
$CGDb->where('name', "s{$Episode->season}e{$Episode->episode}")->delete('tags');
Response::success('Episode deleted successfuly', array('upcoming' => Episodes::getSidebarUpcoming(NOWRAP)));
break;
case "requests":
case "reservations":
$only = $action === 'requests' ? ONLY_REQUESTS : ONLY_RESERVATIONS;
$posts = Posts::get($Episode, $only);
switch ($only) {
case ONLY_REQUESTS:
$rendered = Posts::getRequestsSection($posts);
break;
case ONLY_RESERVATIONS:
$rendered = Posts::getReservationsSection($posts);
break;
}
Response::done(array('render' => $rendered));
break;
case "vote":
if (isset($_REQUEST['detail'])) {
$VoteCountQuery = $Database->rawQuery("SELECT count(*) as value, vote as label\n\t\t\t\tFROM episodes__votes v\n\t\t\t\tWHERE season = ? && episode = ?\n\t\t\t\tGROUP BY v.vote\n\t\t\t\tORDER BY v.vote ASC", array($Episode->season, $Episode->episode));
$VoteCounts = array('labels' => array(), 'datasets' => array(array('data' => array())));
foreach ($VoteCountQuery as $row) {