1

I have tried doing this

$query = "SELECT * FROM policies";
$policies = DB::select($query);

And also this $policies = Policy::all(); Whenever I try to do this, this happensenter image description here

here is my controller function

public function getPremiumCollectionReport (Request $request) {
    $policies = Policy::all();
    echo $policies;
}

Other queries run perfectly well for other models and tables. And if I run the raw query in the sql server, it runs perfectly as well. Can anyone help me find a solution? I don't have a clue.

1
  • You can put exception handling in the code and check what is the error by debugging the code.. Commented Jun 19, 2017 at 5:10

1 Answer 1

1

I just found out that there were too many policies in that table for the server to handle. If I run the query for a smaller number of policies, the query runs successfully. It only happens when I try to select a large number of policies.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.