我在表中获取了我的数据 我有一个数组作为我想要的字符串存储,当我获取这些数据时,我没有用 '""' 获取它,第二个问题我用 slaches 获取它!就像功能主义者一样。这是我得到的
{
"id": 1,
"icon": "/lsapp/public/projects/icon/1558102023logoMazad.png",
"descriptions": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris ",
"fonctionnalites": "[\"CreativeDesign\",\"RetinaReady\",\"ModernDesign\",\"DigitalMarketingBranding\",\"rcveq\"]",
"screenshoot": "[\"/lsapp/public/projects/screenshoot/1558102023mazad1.png\",\"/lsapp/public/projects/screenshoot/1558102023mazad2.png\",\"/lsapp/public/projects/screenshoot/1558102023mazad3.png\",\"/lsapp/public/projects/screenshoot/1558102023mazad4.png\"]",
},
我想要这样
{
"id": 1,
"icon": "/lsapp/public/projects/icon/1558102023logoMazad.png",
"descriptions": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris ",
"fonctionnalites": ["CreativeDesign","RetinaReady","ModernDesign","DigitalMarketingBranding","rcveq"],
"screenshoot": ["/lsapp/public/projects/screenshoot/1558102023mazad1.png\","/lsapp/public/projects/screenshoot/1558102023mazad2.png","/lsapp/public/projects/screenshoot/1558102023mazad3.png","/lsapp/public/projects/screenshoot/1558102023mazad4.png"],
},
这就是我为得到结果所做的
public function getproject(Request $request)
{
$services = WebProjects::all();
return response()->json($services);
}
潇湘沐
德玛西亚99