skip to Main Content

Array key on laravel controller group by

I want to get data plan by date, then I use carbon on laravel to get it. this my query on laravel controller $data = DB::table('visit_plan') ->join('outlets', 'outlets.id', '=', 'visit_plan.id_outlet') ->select('outlets.id', 'outlets.name') ->get() ->groupBy(function($date) { return $this->attributes['date'] = Carbon::parse($date->date)->format('Y-m-d'); });…

VIEW QUESTION

Postgresql, json, query

I want the syntax to query in postgresql for the data in Json format of the following form into tabular format. data(JSON): 1. { "attr1":"v1", "attr2":[{"subattr":"a1","subattr2":"aa1"},{"subattr":"a2","subattr2":"aa2"}],"attr3":"vv1"} 2. { "attr1":"v2", "attr2":[{"subattr":"b1","subattr2":"bb1"},{"subattr":"b2","subattr2":"bb2"},{"subattr":"b3","subattr2":"bb3"}],"attr3":"vv2"} I am stuck with querying the elements in the "attr2".…

VIEW QUESTION

Print specific part from an URL by php

I would like to print only specific part from an Url like for example if i got on response an URL like this : https://tvoauth.zapi.com/?client=zapi-web-1&session=XRpC8tmn2_VUz6temt_j19BIGymiYyd5ZOLoWtp1H5U&scopes=false&redirect=https%3A%2F%2Ftv.zapi.com I want to print only this part exactly : XRpC8tmn2_VUz6temt_j19BIGymiYyd5ZOLoWtp1H5U I have tried to use…

VIEW QUESTION

Javascript – How can I push the array ONCE instead of 4 times?

I have an array of Objects (Jerseys) and some are Authentic (true) and some are Replicas (Authentic: False) const Jerseys = [{"Player":"Shaq","Team":"Miami Heat","Sport":"Basketball","Authentic":true,"Price":325,"Year":2007,"jerseyNum":32},{"Player":"Michael Jordan","Team":"Chicago Bulls","Sport":"Basketball","Authentic":true,"Price":300,"Year":1992,"jerseyNum":23},{"Player":"Ken Griffey","Team":"Seattle Mariners","Sport":"Baseball","Authentic":true,"Price":300,"Year":1989,"jerseyNum":24},{"Player":"Tim Hardaway","Team":"Miami Heat","Sport":"Basketball","Authentic":false,"Price":135,"Year":1996,"jerseyNum":10},{"Player":"Dan Marino","Team":"Miami Dolphins","Sport":"Football","Authentic":true,"Price":300,"Year":1994,"jerseyNum":13},{"Player":"Dan Marino","Team":"Miami Dolphins","Sport":"Football","Authentic":true,"Price":300,"Year":1990,"jerseyNum":13},{"Player":"Tim Anderson","Team":"Miami Marlins","Sport":"Baseball","Authentic":false,"Price":125,"Year":2021,"jerseyNum":15},{"Player":"Will Smith","Team":"Bel-Air","Sport":"Basketball","Authentic":false,"Price":135,"Year":2007,"jerseyNum":41},{"Player":"Pete Rose","Team":"Cinncinatti Reds","Sport":"Baseball","Authentic":true,"Price":300,"Year":1975,"jerseyNum":14},{"Player":"Derrick Rose","Team":"Chicago Bulls","Sport":"Basketball","Authentic":true,"Price":300,"Year":2008,"jerseyNum":1},{"Player":"Unknown","Team":"Miami…

VIEW QUESTION
Back To Top
Search