1
我试图在Laravel 5.1中创建一个资源控制器(for CRUD)。我已将此添加到应用程序/ HTTP/routes.php文件:资源路由返回空白页
<?php
Route::get('/', function() {
return view('home');
});
Route::get('/home', function() {
return view('home');
});
Route::resource('markers', 'MarkerController');
Route::get('auth/login', 'Auth\[email protected]');
Route::post('auth/login', 'Auth\[email protected]');
Route::get('auth/logout', 'Auth\[email protected]');
Route::get('auth/register', 'Auth\[email protected]');
Route::post('auth/register', 'Auth\[email protected]');
这是我的控制器:http://pastebin.com/mcm6kfSB
这是我的看法:
@if (Session::has('message'))
<div class="alert alert-info">{{ Session::get('message') }}</div>
@endif
<table class="table table-striped table-bordered">
<thead>
<tr>
<td>Name</td>
<td>x</td>
<td>y</td>
<td>Actions</td>
</tr>
</thead>
<tbody>
@foreach($markers as $key => $value)
<tr>
<td>{{ $value->name }}</td>
<td>{{ $value->x }}</td>
<td>{{ $value->y }}</td>
<td>
<a href="markers/index">Show</a>
<a href="markers/idnex">Edit</a>
</td>
</tr>
@endforeach
</tbody>
</table>
当我去http://partyrecycler.dev/markers/index我得到一个没有内容的空白页面,我不知道为什么,帮助?
这工作,谢谢! – Alexander