79532756

Date: 2025-03-25 05:29:28
Score: 0.5
Natty:
Report link

This is a very old question, but it comes up prominently in searches.

In Laravel 12.x (current in 2025) you have DB::selectOne() for the first row, and DB::scalar() for the first value:

$weekOfYear = DB::scalar("SELECT DATE_PART('week', CURRENT_DATE) woy");

https://laravel.com/docs/11.x/database#selecting-scalar-values

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: eukras