public function getView(Request $request) { $speaker = Speaker::findOrFail($request->id); if (count($speaker->image)) { $speaker->image_name = $speaker->image->name; } if (count($speaker->file)) { $speaker->file_name = $speaker->file->name; } return response()->json($speaker); }
public function get($id) { $speaker = Speaker::findOrFail($id); return $speaker; }