Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

laravelblade's avatar

How to set URL/Slug as date and timestamp?

How to set URL/Slug as date and timestamp upon upload, so whenever an item is uploaded the url is different everytime , for example www.example.com/31/12/20162230

0 likes
1 reply
Snapey's avatar

You can have whatever you like as routes, but you probably need to have a resource name in there, for instance;

www.example.com/post/31/12/20162230

Route::get('post/{day}/{month}/{slug}', 'PostsController@show');

Please or to participate in this conversation.