I realized that using whereBetween is not that easy. Personally I have faced problem to use that. Here is the final thought that I can come out- $month = 01; $year = 2018; return User::whereBetween('created_at', [$year . "-" . $month . "-01 00:00:00", $year . "-" . $month . "-" . cal_days_in_month(CAL_GREGORIAN, $month, $year) . " [...]tisuchi
Spending time to write simplest PHP Code.
Here is the code that how can you convert number to month name in PHP. Think of it, you have a month number 01, 02, … that is equivalent to January, February, … $monthNum = 3; $dateObj = DateTime::createFromFormat('!m', $monthNum); $monthName = $dateObj->format('F'); // March Alternative way, you can try this- $monthNum = [...]tisuchi
If you are facing how to write query as Group By in django, this post might be helpful for you. Imagine that, you want to write query like this way. SELECT userid, COUNT(userid) AS ucount FROM members GROUP BY userid Now, in your view’s function, add- //import library from django to count record from django.db.models import Count [...]tisuchi
If you have a plan to do virtual host in localhost on Mac via Xampp, I think this post will help you that how to configure virtual hosts in xampp on mac. Enable VirtualHosts The first thing you’ll need to do is open the file /Applications/XAMPP/xamppfiles/etc/httpd.conf . Look for the following lines: # Virtual hosts #Include [...]tisuchi
If you are facing any difficulties for Laravel Carbon Convert month name to number conversion, this post might help you to do that. May be you are trying to do- And you are getting answer is 5, whereas it should be 4. In this case, try this-tisuchi
Imagine that, you have a invoice number 2017-0001, 2017-0002 so forth. In the beginning of 2018, it would be something like this 2018-0001, 2018-0002 and more… . Meaning, first day of each year, it will be renewed based on year. In laravel, you can do it like this way.tisuchi