Skip to content

Find date diff output as each year

Now I use date_diff() to find diff of date public function getDateDiff($date1,$date2){ $date1 = date_create(‘2019-12-29’); $date2 = date_create(‘2020-01-05’); $diff = date_diff($date1,$…

MySQL, PHP – WHERE clause

I create query as below, but I have a problem with WHERE part: So if I have products i.e.: DB Fiddle APPLE belonging to the categories: FRUIT, GREEN, ROUND WHEEL belonging to the categories: MACHINES, BLACK, ROUND BANANA belonging to the categories: FRUIT, YELLOW, CUBOID PHONE belonging to the categories: ELE…

Laravel tap into moment before query execution

I am using Laravel scopes to limit what the end user can see based on some provided input, however with my current use-case this is no longer acceptable. Before applying additional queries, I would …