Laravel queries all the articles under it through the tag tag.

post table is the article table, the primary key is id
tag table is the tag table, the primary key is id
post_tag is the intermediate mapping table, and the field is post_id,tag_id
now I want to select tag 1 to find out that all the
tags and articles under tag 1 are many-to-many
I set up a controller in the tag

clipboard.png

clipboard.png

clipboard.png

clipboard.png
the data I take out in this way is particularly troublesome to display on the page. Is there any better idea?

Feb.26,2021

finally figured it out.
rewrite the model code

clipboard.png

clipboard.png

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b99b91-2f1b0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b99b91-2f1b0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?