简体   繁体   English

错误将项目Laravel上传到Web

[英]Error Upload Project Laravel to Web

I just finished building my Laravel 5 project and amd trying to upload it to the internet. 我刚刚完成了Laravel 5项目的构建,并试图将其上传到互联网。 I upload all of my files, it shows me an error: 我上传了所有文件,它显示了一个错误:

Parse error: syntax error, unexpected '[' in /home/laderra2/public_html/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 381 解析错误:语法错误,/第381行的/home/laderra2/public_html/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php中出现意外的[[]

Here's my directory of my Laravel Project: 这是我的Laravel项目的目录:

在此处输入图片说明

In this project I'm not using public folder to access my resource file. 在此项目中,我不使用公用文件夹来访问我的资源文件。 I tried to copy my list directory and file into public_html and get an error from this function : 我试图将我的列表目录和文件复制到public_html并从此函数得到错误:

function resource($name, $controller, array $options = []){
  return app('router')->resource($name, $controller, $options);
}

Any solution for this? 有什么解决办法吗?

从5.4.0版开始,PHP中已添加了短数组语法。

e.g. $a = [1, 2, 3, 4]; or $a = ['one' => 1, 'two' => 2, 'three' => 3, 'four' => 4];.

Try 尝试

function resource($name, $controller, array $options = array())
{
    return app('router')->resource($name, $controller, $options);
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM