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)
-
Organization : Keeping each site's configuration in separate files makes the server easier to manage, especially when hosting multiple...
-
https://www.nicesnippets.com/blog/laravel-9-comment-system-example-tutorial
-
Laravel Queues allow you to delay a time-consuming task until a later time. By delaying the time-consuming task, you can improve the perfo...
No comments:
Post a Comment