Laravel 关联模型怎么关联?
如:Province为省份,City为城市,下面是关联关系
$a = Province::find(1)->City;
$b = Province::find(1)->City->get();
$c = Province::find(1)->City();
$d = Province::find(1)->City()->get();
dd($a,$b,$c,$d);
我打印出的结果很是迷惑,望指点?
推荐文章: