Problems with Mardown and foreach dynamic rows Good afternoon everyone,
I have a problem with the dynamic rows to show information from a DB in a Markdown using the table component if I put a foreach to the rows after the titles do not generate the rows in the table but it shows the data with the ones with the character | in the mail, but removing the foreach if you generate the entire table. this is because?
@component('mail::table')
| Código | Descripción | Cantidad |
|:------: |:----------- |:--------: |
@foreach($dtmov as $dt)
| 00003 | Right-Aligned | 50 |
@endforeach
Hello @rafaelg21
i tried to reproduce your code, and was unable to do so
Did you forget to add "@endcomponent " at the end of your code?
Here is my test code:
@component('mail::table')
| Laravel | Table | Example |
| ------------- |:-------------:| --------:|
| Col 2 is | Centered | |
| Col 3 is | Right-Aligned | |
@endcomponent
@component('mail::table')
| Código | Descripción | Cantidad |
|:------: |:----------- |:--------: |
@foreach([1,2,3] as $dt)
| 00003 | Right-Aligned | 50 |
@endforeach
@endcomponent
Thank you very much @mushood , I think that was the problem and the problem was solved.
@component('mail::table')
| Código | Descripción | Cantidad |
|:------: |:----------- |:--------: |
@foreach($dtmov as $dt)
| {{$dt->cod_product}} | {{$dt->name_product}} | {{$dt->qty}} |
@endforeach
@endcomponent
Do you know any class\method which create markdown format from database collection to markdown ?
Please sign in or create an account to participate in this conversation.