Logout fix (#28)

This commit is contained in:
Servetas George 2017-06-22 00:06:36 +03:00 committed by Nabeel Shahzad
parent 1c854da1e5
commit 10128e4817
2 changed files with 9 additions and 3 deletions

View File

@ -80,8 +80,14 @@
@if(Entrust::hasRole('admin')) @if(Entrust::hasRole('admin'))
<a href="{{ url('/admin') }}">Admin</a> <a href="{{ url('/admin') }}">Admin</a>
@endif @endif
<a href="{{ url('/dashboard') }}">Dashboard</a> <a href="{{ url('/user/dashboard') }}">Dashboard</a>
<a href="{{ url('/logout') }}">Logout</a> <a href="{!! url('/logout') !!}" class="btn btn-default btn-flat"
onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
Sign out
</a>
<form id="logout-form" action="{{ url('/logout') }}" method="POST" style="display: none;">
{{ csrf_field() }}
</form>
@endif @endif
</div> </div>
@endif @endif

View File

@ -8,7 +8,7 @@ Route::get('/home', 'HomeController@index');
* These are only visible to a logged in user * These are only visible to a logged in user
*/ */
Route::group([ Route::group([
'namespace' => 'Frontend', 'prefix' => 'frontend', 'as' => 'frontend.', 'namespace' => 'Frontend', 'prefix' => 'user', 'as' => 'frontend.',
'middleware' => ['role:admin|user'], 'middleware' => ['role:admin|user'],
], function () { ], function () {
Route::resource('dashboard', 'DashboardController'); Route::resource('dashboard', 'DashboardController');