skip to Main Content

How to get current month record in laravel?

Need to get record of current month but query return the wrong result.There is only one record in db.but i get wrong count for the current month $data = UserData::select( DB::raw("count(phone) as total") ) ->whereMonth('creation_date', Carbon::now()->month) ->get(); return view('kpidata', compact('data'));…

VIEW QUESTION

Laravel HasMany relationship not displaying all records

I have two models EcommerceOrders and Medicines class EcommerceOrders extends Model { use HasFactory; protected $table = 'ecommerce_orders'; protected $fillable = [ 'user_id', 'manager_id', 'first_name', 'last_name', 'phone_number', 'email', 'address', 'city', 'zip_code', 'other_info', 'products', 'total_price', 'qr_code', 'status', 'assigned_to', 'save_client_info', ]; class…

VIEW QUESTION
Back To Top
Search