【发布时间】:2014-04-27 12:00:48
【问题描述】:
所以我是 Laravel 的新手,我关注 Tutorial 但是当我检查我的应用程序时,我得到了 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);
}
第二条路线:
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,请提供任何帮助 :)
【问题讨论】:
-
暂时忘记 Laravel,原生 PHP 脚本可以正常加载吗?即
test.php<?php echo 'It works'; -
是的,当我在我的 Laravel 文件夹中添加一个 info.php 并使用 localhost:8080/laravel/info.php 检查它时,它工作正常!!
标签: php nginx laravel laravel-4