So i have this in my controller
public function index()
{
$posts = Post::where('reviewed', '=' , 1)->orderBy('created_at', 'DESC');
$url = asset('img/logo.gif');
$mytime = Carbon\Carbon::now();
$this->layout->content = View::make('partials.index', array('posts' => $posts->paginate(9)))->with('img', $url)->with('date' , $mytime);
}
What i want to happen is i want to sort out my post by created_at time stamp but i dont know how to do this properly and this line in $post var ->orderBy('created_at', 'DESC') doesn't seem to work.
so how can i do this properly?