Search code examples
laraveleloquentlumen

Object could not be converted to string (laravel)


My question is, why does the following not work?

    $questions = Question::where($queryatypes);

    $questions->get();

I'm getting the following Error:

Object of class Illuminate\Database\Eloquent\Builder could not be converted to string


Solution

  • Please check the answer

    $questions = Question::where($queryatypes);
    $questions = $questions->get();