public function show(Article $article)
{
return view('articles.show',['article'=>$article]);
}
if this method wanted to translate into API or rather return not the whole set but the single element so it works for me and I pass the data to the view, api does not work.
it makes me empty together.
I used the following function before and it worked:
public function show($id)
{
return response()->json(Article::find($id), 200);
}
I just wanted to take advantage of the techniques from lesson 26
Leverage Route Model Binding
id=1,
user_id: 1,
title: "Consequatur est amet enim illo nihil.",
excerpt: "Incidunt esse quod praesentium aut velit veniam vitae aut.",
body: "Rem dolorem ut quas qui fugiat explicabo. Rerum temporibus delectus voluptas officiis quia aut. Et molestiae et unde quibusdam hic. Nemo et error nobis ea repellendus adipisci eaque.",
updated_at: "2020-09-17 11:05:43",
created_at: "2020-09-17 11:05:43",
id: 1,
},
],
}