My problem is that I want to get data form the database table from the created_at
attributes as per year and month only. The code I have tried is:
$post= Mjblog::select(DB::raw('YEAR(created_at) year, MONTH(created_at) month'));
$posts_by_y_m = $post->where('created_at',$post)->get();
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire