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