我刚刚安装了新的laravel 5.1,只显示了根页面
Route::get('/', function () {
return view('welcome');
});
Run Code Online (Sandbox Code Playgroud)
它工作得很好,但不是任何其他路线不工作:
Route::get('user', function () {
return "hello";
});
Run Code Online (Sandbox Code Playgroud)
它会抛出未找到的异常404.请帮我摆脱这个.提前致谢.
顾客与工作的关系
public function customer() {
return $this->belongsTo('App\Customer','customerid');
}
public function jobs(){
return $this->hasMany('App\Job','customerid');
}Run Code Online (Sandbox Code Playgroud)
在控制器中
protected function getJobs(){
$jobs = Job::Join('customer','jobs.customerid','=','customer.id')
->select(array('jobs.id','customer.firstname','customer.lastname','jobs.jobstatus','jobs.trialdate','jobs.deliverydate'));
return Datatables::of($jobs)
->addColumn('action', '<a class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="top" title="Edit" href="{{ URL::to(\'updatejob/\'.$id) }}"><i class="fa fa-pencil"></i></a>')
->make();
}Run Code Online (Sandbox Code Playgroud)
SQLSTATE[42S22]: Column not found: 1054 Unknown column '0' in 'order clause' (SQL: select `jobs`.`id`, `customer`.`firstname`, `customer`.`lastname`, `jobs`.`jobstatus`, `jobs`.`trialdate`, `jobs`.`deliverydate` from `jobs` inner join `customer` on `jobs`.`customerid` = `customer`.`id` order by `0` asc limit 10 offset 0)Run Code Online (Sandbox Code Playgroud)
我从2天开始坚持这个问题,请帮助我摆脱这个问题