Scroll to top
Use DB Class more than your Models

Use DB Class more than your Models

Use DB Class more than your Models You may be thinking wow its so easy so i call Posts::find(1); If you dont need to dont use it . Below are some situations when…

admin September 11, 2014
Next and Prev Post Links

Next and Prev Post Links

Next and Prev Post Links Find next and previous posts using current displayed post_id $next = DB::table("posts")->where("id", ">", $post_id)->first(); $prev…

admin September 11, 2014
Updated_at and created_at are empty or zeros

Updated_at and created_at are empty or zeros

Updated_at and created_at are empty or zeros If you use DB class and thinking that it will fill updated_at and created_at then you are wrong it wont . It will…

admin September 11, 2014