我在laravel中创建了一个新视图,路径和控制器,当我去访问视图时出现错误,所有其他视图都没问题。
错误 shopalescontroller.php第11行中的FatalErrorException:语法错误,意外'类' (T_CLASS),期待','或';'
这是我的店铺销售总监:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\shopsales
class shopsalescontroller extends Controller : (line 11)
{
public function index()
{
$storeNum = request('storeNum');
$results = shopsales::where('StoreNumber','=',$storeNum)->get();
return view('shopSales',compact('results'));
}
}
PHP 5.6.3版 Zend引擎v2.6.0
Laravel框架版本5.2.45
答案 0 :(得分:0)
只需删除代码中的:(第11行)文字
即可<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\shopsales
class shopsalescontroller extends Controller {
public function index() {
$storeNum = request('storeNum');
$results = shopsales::where('StoreNumber', '=', $storeNum)->get();
return view('shopSales', compact('results'));
}
}
答案 1 :(得分:0)
你错过了这一行的分号:
FROM node:7
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Install app dependencies
COPY package.json /usr/src/app/
RUN npm install
# Copy app source
COPY src /usr/src/app/src
# Compile app sources
RUN npm run compile
# Remove dev dependencies
RUN npm prune --production
# Expose port and CMD
EXPOSE 8080
CMD [ "npm", "start" ]