Пример #1
0
 /**
  * Show a list of all the languages posts formatted for Datatables.
  *
  * @return Datatables JSON
  */
 public function data()
 {
     $news = News::join('language', 'language.id', '=', 'news.language_id')->join('news_category', 'news_category.id', '=', 'news.newscategory_id')->select(array('news.id', 'news.title', 'news_category.title as category', 'language.name', 'news.created_at'))->orderBy('news.position', 'ASC');
     return Datatables::of($news)->add_column('actions', '<a href="{{{ URL::to(\'admin/news/\' . $id . \'/edit\' ) }}}" class="btn btn-success btn-sm iframe" ><span class="glyphicon glyphicon-pencil"></span>  {{ Lang::get("admin/modal.edit") }}</a>
                 <a href="{{{ URL::to(\'admin/news/\' . $id . \'/delete\' ) }}}" class="btn btn-sm btn-danger iframe"><span class="glyphicon glyphicon-trash"></span> {{ Lang::get("admin/modal.delete") }}</a>
                 <input type="hidden" name="row" value="{{$id}}" id="row">')->remove_column('id')->make();
 }