[英]Error in exception handler: Trying to get property of non-object
Error in exception handler: Trying to get property of non-object (View: /var/www/html/.../app/views/emails/soporte/show.blade.php) in /var/www/html/.../app/storage/views/d95e004dee8a72a82513c767ba381e9f:4异常处理程序中的错误:试图在 /var/www/html/ 中获取非对象的属性(查看:/var/www/html/.../app/views/emails/soporte/show.blade.php)。 ../app/storage/views/d95e004dee8a72a82513c767ba381e9f:4
And this is the app/views/emails/soporte/show.blade.php这是 app/views/emails/soporte/show.blade.php
<html>
@if( isset( $exception ) )
<ol>
<li>User: {{ Session::get( 'user' )->usicodusu }}</li>
<li>Error: {{$exception->getMessage()}}</li>
<li>Code: {{$exception->getCode()}}
<li>File: {{$exception->getFile()}}</li>
<li>Line: {{$exception->getLine()}}</li>
<li>Description: {{$exception->getTraceAsString()}}</li>
</ol>
@elseif( isset( $description) )
<ol>
<li>User: {{ Session::get( 'user' )->usicodusu }}</li>
<li>Function: {{$function}}</li>
<li>Line: {{$line}}</li>
<li>File: {{$file}}</li>
<li>Description: {{$description}}</li>
</ol>
@elseif( isset( $subject ) )
<h1>
{{$subject}}
</h1>
@endif
Try to give a default value if something doesn't exist, so you can see where is the problem:如果某些东西不存在,请尝试给出默认值,这样您就可以看到问题出在哪里:
@if( isset( $exception ) )
<ol>
<li>User: {{ Session::get( 'user' ) ? Session::get( 'user' )->usicodusu : 'no user session' }}</li>
<li>Error: {{$exception->getMessage() ?? 'no getMessage'}}</li>
<li>Code: {{$exception->getCode() ?? 'no getCode'}}
<li>File: {{$exception->getFile() ?? 'no getFile'}}</li>
<li>Line: {{$exception->getLine() ?? 'no getLine'}}</li>
<li>Description: {{$exception->getTraceAsString() ?? 'no getTraceAsString'}}</li>
</ol>
@elseif( isset( $description) )
<ol>
<li>User: {{ Session::get( 'user' ) ? Session::get( 'user' )->usicodusu : 'no user session' }}</li>
<li>Function: {{$function ?? 'no function'}}</li>
<li>Line: {{$line ?? 'no line'}}</li>
<li>File: {{$file ?? 'no file'}}</li>
<li>Description: {{$description}}</li>
</ol>
@elseif( isset( $subject ) )
<h1>
{{$subject}}
</h1>
@endif
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.