I have just started learning Laravel and would like to know if it is possible to create a Route::resource that would allow me to access the below URL using RESTful methods:
I would like the URL to look like this:
http://example.com/articles/2014/09/22/this-is-the-article-title
And I would like to access this from my ArticlesController using:
//GET articles/{year}/{month}/{day}/{title}
public function show($year, $month, $day, $title) {
$article = //find article in DB
return View::make('articles.show')->with('article', $article);
}
From what I've gathered so far, this can somehow be accomplished by doing something like the below in the routes.php file:
Route::resource('year.month.day.articles', 'ArticlesController');
But that doesn't quite look right to me.
Does anyone have any suggestions?