Call to undefined function App\select()

I have in my model this function and i get the error in my log.

What could be causing this or do i have import a lib?

PS: Laravel Beginner

Call to undefined function App\select()

Model

public function daily_toast() 
{    
    return $this->daily—>select(‘toast’, DB::raw('count(*) as daily_toast'))->get();  
}

1 answer

  • answered 2018-07-12 07:35 J. Doe

    I think daily() is relation, try this:

      public function daily_toast() 
      {    
         return $this->daily()->select(‘toast’, DB::raw('count(*) as daily_toast'))->get();  
      }