where('ROL_CODE', $rolCode); $query = $query->get()->first(); if (is_null($query)) { return []; } else { return $query->toArray(); } } }