private function _getPostsByTermTaxonomy($id) { return Post::join('post_taxonomy', function ($join) use($id) { $join->on('post_taxonomy.object_id', '=', 'posts.id')->on('post_taxonomy.term_taxonomy_id', '=', \DB::raw($id)); })->where(['post_type' => 'post', 'post_status' => 'publish'])->orderBy('id', 'DESC')->get(['posts.id', 'posts.post_author', 'posts.post_date', 'posts.post_title', 'posts.post_excerpt', 'posts.post_name', 'posts.post_avatar', 'posts.updated_at']); }
/** * Remove the specified resource from storage. * * @param int $id * * @return Response */ public function destroy($id) { Post::destroy($id); return redirect()->route('admin::@dmin-zone.posts.index'); }