/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $perPage = 15; $posts = Post::orderBy('id', 'desc')->paginate($perPage); return view('Admin::post.index', ['posts' => $posts, 'perPage' => $perPage]); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $posts = Post::orderBy('number', 'asc')->orderBy('id', 'desc')->get(); return view('Admin::post.index', ['posts' => $posts]); }