public function index_onDelete() { if (($checkedIds = post('checked')) && is_array($checkedIds) && count($checkedIds)) { foreach ($checkedIds as $postId) { if (!($post = EmItem::find($postId)) || !$post->canEdit($this->user)) { continue; } $post->delete(); } Flash::success('Successfully deleted those posts.'); } return $this->listRefresh(); }
public function posts() { $alleposter = EmItem::orderBy('created_at', 'desc')->take($this->property('maxItems'))->get(); return $alleposter; }