Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace AppHttpControllers;
- use IlluminateHttpRequest;
- use AppPosts;
- class PostController extends Controller
- {
- public function index()
- {
- $posts=Posts::latest()->paginate(5);
- // print_r($posts);exit;
- return view('post.index',compact($posts))
- ->with('i',(request()->input('page',1)-1)*5);
- }
- @foreach($posts as $post)
- <?php echo $post->title; ?>
- @endforeach
- </table>
- @endsection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement