Support the ongoing development of Laravel.io →
Configuration Requests Architecture
Last updated 1 year ago.
0

Hi

Pagination is independent of routing design, sample of laravel pagination:

http://fluzo.info/blog

My routes of blog:

https://github.com/fluzo/blog/blob/master/src/routes.php

Suggestion:

/categories/category_id or category_slug -> List of post of this category.

/categories/category_id or category_slug/post_id or post_slug or post_slug-id -> View post.

best:

/category_slug -> List of post of this category.

/category_slug/post_slug-id -> View post.

Last updated 1 year ago.
0

Thank your for your reply Fluzo. But I want also to get posts date by date basis. What is your suggestion for that?

--

Last updated 1 year ago.
0

I guess you can do this :

Route::get('{category_slug}/{date}/{post_slug}', 'BlogController@show');

And access the values in your method, like :

public function show($category_slug, $date, $post_slug) {...}

Also, keeping date like 18052014 looks more of an id, try category/18-05-2014/lorem-ipsum-do-sit-amet

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

mehmet mehmet Joined 18 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.