Esempio n. 1
0
 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();
 }
Esempio n. 2
0
 public function posts()
 {
     $alleposter = EmItem::orderBy('created_at', 'desc')->take($this->property('maxItems'))->get();
     return $alleposter;
 }