Route::get('/{slug}','SiteController@postDetails');
//Example URL: example.com/awesome-post-title public function postDetails($slug){ $post = Cache::remember('posts.'.$slug, function($slug) use($slug) { return Post::where('slug',$slug)->first(); }); return view('frontend.posts.post-details',['post'=>$post]); } To read more: https://bit.ly/speed-up-laravel-website
Subscribe to:
Post Comments (Atom)
-
Composer is a major part of the Laravel MVC Framework, but it also exists without Laravel. In fact you could use it in any project. This a...
-
How to Answer Technical Questions Like a Pro Answering technical interview questions is all about showing off your problem-solving skills an...
-
Vuetify is a popular UI framework for Vue apps. In this article, we’ll look at how to work with the Vuetify framework. Color Picker Inputs W...
No comments:
Post a Comment