score:0
you can use pluck() instead of get()
for this:
$prd = db::table('order_details')
->join('products', 'order_details.product_id', '=', 'products.id')
->select('products.name', db::raw('sum(quantity) as quantity'))
->groupby('products.name')
->orderby('quantity', 'desc')
->pluck('name', 'quantity');
Source: stackoverflow.com
Related Query
- Format array output to be readable by chartjs in Laravel
- Laravel 5.1 format date array for chart.js data
- what is output format of Utils? (using chartjs in vanillajs, not react/angular)
- how to set a custom tick format in chartjs options from laravel controller?
- Chartjs v2 - format tooltip for multiple data sets (bar and line)
- Chartjs - data format for bar chart with multi-level x-axes
- How to access labels array using chart plugin (Chart.pluginService.register) in Chartjs 2.x?
- ChartJs php array into 'labels' and 'datasets'
- How to add ChartJS code in Html2Pdf to view image
- how to fix this error Array to string conversion in laravel and chartjs?
- Dynamic colours in chartJS based on entries in the array
- Php array and chartjs
- How to install chartjs on laravel 6 via npm
- How do I add time sourced from an external source as an X axis to a ChartJS graph?
- Chartjs not working with d3 from csv source
- ChartJS - can't display all the items in the array
- Chartjs barchart generate data for an array dataset
- How to display chart using Chartjs with JSON data in Laravel
- Passing an Array from a Flask view to the javascript code of another view
- How to create a custom tooltip for chartJS graph with data in JSON array in JavaScript?
- Output array of hashes from Ruby on Rails to chart.js
- Passing JSON data from PHP array into ChartJS
- ChartJS 3.0 - Number format
- Get last 6 month name in Array for Chartjs
- Line ChartJs would not display - Date format issue
- Can I use a custom data format when using Vue + Chartjs
- I can't change the legend position in Laravel Charts & ChartJS
- Passing data from a controller to ChartJS - Laravel
- ReactJs issues with setstate on array in ChartJs
- Referencing locally declared variable into an array for data for chartjs
More Query from same tag
- How I create a dropdown for radar chartjs from mysql database?
- How to detect click on chart js 3.7.1 axis label?
- Syntax Error: Token '{' invalid key at column 2 of the expression [{{id}}] starting at [{id}}]?
- Fix ChartJS Values not Well Displayed
- Uncaught Error: [$injector:modulerr] (Error came up when I included chart.js)
- Chart.js - How to set animation speed?
- issue upgrading from chart.js 1 to 3.5
- ReactChart2 - Line is not a registered Element
- Reduce size of chart within the canvas
- Refencing a plugin in ChartJs.Blazor
- How to use chart.js script to draw multiple pie Charts
- Uncaught Error: [$injector:modulerr] Error: [$injector:nomod] Module 'chart.js' is not available
- (Vue, ChartJS) Create gradient background for chart from child component canvas context
- Wrong chart.js points get highlighted on hover
- ChartJs is not working in angular 4 with no errors
- Chart.js chart.update() method is not doing anything
- how to add data from database to chartjs-plugin-streaming
- Angular 4: Different color for bar in bar chart dynamically using ChartJS
- How do I force Chart.js axes min and max with react-chartjs-2?
- Chart.js tooltip at any point on the chart
- Calculate value in tooltip in ChartJS
- ng2-charts: How to set fixed range for y axis
- how to access class variables inside chart.js custom tooltip interface
- ChartJs canvas showing previous graph when changing Graph types
- make chartJS labels clickable and get label details
- Chart.js chart by passing data through the controller MVC
- My ChartJS Line needs to click the color legend first before it plots the data
- how to put "%" in chart pie (chartjs)
- How to wrap X axis labels to multi-lines (X axis label formatting) in ng2-Charts?
- How to have custom colors in ng2-charts and chart.js according to data?