YourModel::where('user_id','=','2')
->where(DATE_FORMAT(created_at,'%d-%m-%Y'),'<', '11-09-2014')
->orderBy('created_at','desc')
->first();
.
For the last method (first) it will return only the first row that match, the get() method will return all the result . Hope that help !
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community