所以我是Laravel的新手,我遵循本教程,但当我检查我的应用程序时,我得到了IP-TEST-NGINX,更多细节,这是我的代码,
第一个索引动作:
class ServiceController extends BaseController {
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
// get all the services
$services = Service::all();
// load the view and pass the services
return View::make('services.index')->with('service', $services);
}
Second my route:
Route::resource('services', 'ServiceController');
然后我的模型:
<?php
class Service extends Eloquent
{
/**
* The database table used by the model.
*
* @var string
*/
public static $table = 'services';
}
最后我的观点:
@foreach($services as $key => $value)
<tr>
<td>{{ $value->user_id }}</td>
<td>{{ $value->domain }}</td>
<td>{{ $value->service_name }}</td>
当我去url: http://localhost:8080/laravel/services
时,我得到了错误IP-TEST-NGINX,任何帮助请:)
您正在返回service
而不是services
的视图
应为:
return View::make('services.index')->with('services', $services);
还取决于您是否在运行虚拟主机,您可能需要点击http://localhost:8080/laravel/public/services