Что я делаю не так ?
Мой routes.php
<?php
Route::get('/', 'WelcomeController@index');
Route::get('home', 'HomeController@index');
Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
]);
Route::get('admin', ['uses' => 'admin\AdminController@index', 'as' => 'admin','middleware' => 'auhtgust']);
Route::get('admin/user', ['uses' => 'admin\UserController@index', 'as' => 'admin']);
Route::resource('admin/user','admin\UserController');
Мое представление ( часть его):
@foreach ($user as $user)
<tr>
<td>{{$user->name}}</td>
<td>{{$user->email}}</td>
<td>{{$user->tel}}</td>
<td>
@if ($user->active)
<a href="../../index.html"><i class="fa fa-check-square fa-lg"></i></a>
@else
<a href="../../index.html"><i class="fa fa-check-square-o fa-lg"></i></a>
@endif
</td>
<td>
{!! HTML::linkAction('admin\UserController@destroy', 'Удалить' , ($user->id)) !!}
<a href="../../index/{{$user->id}}.html"><i class="fa fa-pencil-square-o fa-lg deystviya"></i></a>
<a href="../../index/{{$user->id}}.html"><i class="fa fa-external-link fa-lg deystviya"></i></a></td>
</tr>
@endforeach
Мой контролер:
<?php namespace App\Http\Controllers\admin;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\User;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Lang;
class UserController extends Controller {
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
App::setLocale('en');
$lang = Lang::get('messages.userlist');
$user = User::all();
return view ('admin.UserView', ['user'=>$user,'lang'=>$lang]);
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
return view ('admin.CreateUser');
}
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store(User $UserModel, Request $request )
{
//dd($request->all());
$UserModel->create($request->all());
return redirect()->route('admin');
}
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
User::find($id)->delete();
return redirect('admin/user');
}
}
Данные выводит без проблем.
Но когда я нажимаю на "Удалить" - я перехожу на страницу ...../index.php/admin/user/8
И вижу просто белый экран.