在Bluehost cPanel上传后,我的Laravel项目出现以下错误.但在本地服务器中没有错误.
解析错误:语法错误,意外的'const'(T_CONST),期望变量(T_VARIABLE)
这是代码
<?php
namespace Doctrine\DBAL;
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
use Doctrine\DBAL\Exception\InvalidArgumentException;
use Closure;
use Exception;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Driver\Connection as DriverConnection;
use Doctrine\Common\EventManager;
use Doctrine\DBAL\Cache\ResultCacheStatement;
use Doctrine\DBAL\Cache\QueryCacheProfile;
use Doctrine\DBAL\Cache\ArrayStatement;
use Doctrine\DBAL\Cache\CacheException;
use Doctrine\DBAL\Driver\PingableConnection;
use Throwable;
use function array_key_exists;
use function array_merge;
use function func_get_args;
use function implode;
use function is_int;
use function is_string;
use function key;
class Connection implements DriverConnection
{
public const TRANSACTION_READ_UNCOMMITTED = TransactionIsolationLevel::READ_UNCOMMITTED;
public const TRANSACTION_READ_COMMITTED = TransactionIsolationLevel::READ_COMMITTED;
public const TRANSACTION_REPEATABLE_READ = TransactionIsolationLevel::REPEATABLE_READ;
public const TRANSACTION_SERIALIZABLE = …Run Code Online (Sandbox Code Playgroud) 我正在从控制器传递 Laravel Blade 模板中的一个数组。但它显示一个错误
无法将 stdClass 类型的对象用作数组
这是我传递给视图的数组
[[{“id”:10,“user_id”:4,“service_speciality”:“4”,“联系人”:“789”,“created_at”:“2018-06-06 05:52:22”,“updated_at ":"2018-06-06 05:52:22","branch_id":3,"name":"lene","doctor_email":"lene@gmail.com","service_name":"牙痛"} ],[{"id":8,"user_id":4,"service_speciality":"1","contact":"123","created_at":"2018-06-06 05:51:41"," Updated_at":"2018-06-06 05:51:41","branch_id":1,"name":"lene","doctor_email":"lene@gmail.com","service_name":"颈部疼痛" }]]
这是我的刀片模板视图,其中出现错误
@foreach($doctor as $datum)
<div id="pg-112-0" class="panel-grid panel-no-style col-lg-12">
@foreach($datum as $data)
<div id="pgc-112-0-0" class="panel-grid-cell col-lg-4">
<div id="panel-112-0-0-0" class="so-panel widget widget_pw_person_profile widget-person-profile panel-first-child panel-last-child" data-index="0">
<div class="person-profile h-card">
<div class="person-profile__container">
<div class="person-profile__basic-info">
<h4 class="person-profile__name p-name">
<a href="{{ url('/doctor/'.str_slug($data["name"], "-").'-'.$data["id"] ) }}">
Dr. {{ $data['name'] }}
</a>
</h4>
<div class="person-profile__label">
{{ $data['service_name'] }} Specialist
</div>
</div>
<a class="btn btn-secondary btn-block person-profile__button" href="{{ url('/doctor/'.str_slug($data["name"], "-").'-'.$data["id"] …Run Code Online (Sandbox Code Playgroud)