mardi 6 octobre 2015

Resource Route returns blank page

I'm trying to create a resource controller (for CRUD) in Laravel 5.1. I added this to the app/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\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::get('auth/logout', 'Auth\AuthController@getLogout');

Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register', 'Auth\AuthController@postRegister');

This is my controller: http://ift.tt/1QWq73s

This is my view:

@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>

When I go to http://ift.tt/1jb4JNz I get a blank page with no content and I don't know why, help?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire