Laravel Error: Method Illuminate\View\View::__toString() must not throw an exception

前端 未结 4 1231
忘了有多久
忘了有多久 2020-12-03 04:13

Have you seen this lovely error while working in Laravel?

Method Illuminate\\View\\View::__toString() must not throw an exception

I have s

4条回答
  •  无人及你
    2020-12-03 05:00

    I encountered error like this when an object in my case $expression = new Expression(); is the same as the parameter variable submitExpression($intent, $bot_id, **$expression**){ check below code for more details.

    private function submitExpression($b_id, $expression){
       $expression = new Expression();
       $expression->b_id = $b_id;
       $expression->expression = $expression;
       $expression->save();
    
    }
    

    so I changed the above code to something like

    private function submitExpression($b_id, $statement){      
       $expression = new Expression();
       $expression->b_id = $b_id;
       $expression->expression = $statement;
       $expression->save(); 
    }
    

    and everything was working fine, hope you find this helpful.

提交回复
热议问题