public function get($id) { if ($object = Object::select(array('objects.id', 'objects.name', 'objects.title', 'objects.excerpt'))->where('id', $id)->first()) { $this->processObject($object); return $object; } }
public function getCategory($id) { if ($category = Object::select(array('objects.id', 'objects.name', 'objects.title', 'objects.excerpt'))->where('id', $id)->first()) { return response()->json($this->processCategory($category)); } }
public function get($id) { $object = Object::select(array('objects.id', 'obj.id AS objectTypeID', 'objects.type', 'objects.name', 'objects.title', 'objects.excerpt', 'objects.content', 'objects.score'))->join('objects as obj', function ($join) { $join->on('obj.name', '=', DB::raw("concat( '_object_type_', objects.type )")); })->where('objects.id', $id)->first(); if ($object) { $this->processObject2($object); return $object; } }