public function getResult($table, Request $request) { $attributes = new Attribute($table); if ($request->ajax()) { return $attributes->getAttributes(); } }