Home  >  Article  >  PHP Framework  >  Two ways to get all comments of the current article in Laravel

Two ways to get all comments of the current article in Laravel

藏色散人
藏色散人forward
2020-11-05 15:54:202053browse

The following is the Laravel tutorial column to introduce two kinds of Laravel to get the current article. All comments, I hope it will be helpful to friends in need!

Two ways to get all comments of the current article in Laravel

1. The first method

use model appends attribute

Two ways to get all comments of the current article in Laravel

  1. Second type

Model association

Two ways to get all comments of the current article in Laravel

##

The above is the detailed content of Two ways to get all comments of the current article in Laravel. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete