Exemplo n.º 1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (Request::get('filter')) {
         $records = Tag::where('title', 'LIKE', '%' . Request::get('filter') . '%')->paginate(10);
     } else {
         $records = Tag::paginate(10);
     }
     return view('back::scope.blog.tags.index', compact('records'));
 }
Exemplo n.º 2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $results = ['columns' => [['编号', 'id'], ['标签名', 'name'], ['创建时间', 'created_at'], ['更新时间', 'updated_at'], ['操作', 'buttons', function ($data) {
         $buttons = [['查看'], ['编辑']];
         return $buttons;
     }]]];
     $paginate = Tag::paginate();
     $results['items'] = $paginate;
     return $this->view(self::URI . '.index', compact('results'));
 }