摘取属性里需要的键值 auth()->user()->projects()->pluck

auth()->user()->projects()->pluck('name', 'id');

id=>name

猜你喜欢

转载自www.cnblogs.com/hakeer/p/11223169.html