skip to Main Content

Laravel Raw Select Returning Repeated Values

I have the following test method in my model, it gets the length of a json column in a row: public function test(){ return $this->select(DB::raw('JSON_LENGTH((SELECT comments FROM lab_evals WHERE id='.$this->id.'))'))->get(); } In tinker it returns this: = IlluminateDatabaseEloquentCollection {#7430 all:…

VIEW QUESTION
Back To Top
Search