4

I've try to dump result of an array with dd , my laravel version is Laravel 6 ,

Any mistakes on my code ?

Below is my code :

   $bills = $bills->with('adminBill.bill');
    $bills = $bills->offset($start)
                     ->limit($limit)
                     ->where('group_code','SA')
                     ->orWhere('group_code','AD')
                     ->get();
    //check SM Balance 
    $sm_coin = DataScoin::with('unit_scoin')->where('status','0')->get();
    dd($sm_coin->toArray());

why i can't expand the array of "unit_scoin" like this picture ?

enter image description here

Anyone can help me out ?

Salman Zafar
  • 3,844
  • 5
  • 20
  • 43
  • Please copy the text into the question, rather than using a picture. On many screens the picture won't render well and it will be difficult to search for the contents. – Dragonthoughts Oct 10 '19 at 15:40
  • I know this message comes to late, but in case it helps someone: That happens when you try to display a lot of data in your "dd". Maybe you can do the "dd" of just the first one, to be able to see the relationship data – buzkall Dec 26 '19 at 11:35

3 Answers3

3

You cannot invoke Javascript code like a button click on the preview tab of the network dev tools, because Javascript is disabled there

Try accessing an HTML page with

<noscript>Something</noscript>

and preview it in the network tab to confirm

Salim Djerbouh
  • 10,719
  • 6
  • 29
  • 61
  • where I should put `` ? – Roby Firnando Yusuf Oct 10 '19 at 14:02
  • @RobyFirnandoYusuf What Saly 3301 is saying is that the expanding/collapsing of the array structure is achieved with JavaScript, but in the Network tab's Preview pane, any JavaScript code (which would be responsible for expanding the array structure) is not executed, so clicking on anything in the Preview pane is useless as it's ignored. – Bogdan Oct 10 '19 at 15:34
  • If your code snippet was from a controller action method, you can replace the `dd($sm_coin->toArray());` line with this line `return ;`. Now if you check your preview tab again and see the word **Something** printed, it means that JavaScript is disabled there since the contents of ` – Bogdan Oct 10 '19 at 15:37
1

Behavior of dumps are different for local environment with debug enabled and production environment with debug disabled in .env file. On local with debug enabled everything works fine.

starball
  • 20,030
  • 7
  • 43
  • 238
0

I had the same problem. If you are still facing this problem, this might be because of Google automatically translating the page, thus the arrays are not expanding.