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'))
<a href="{{ url('/admin') }}">Admin</a>
@endif
<a href="{{ url('/dashboard') }}">Dashboard</a>
<a href="{{ url('/logout') }}">Logout</a>
<a href="{{ url('/user/dashboard') }}">Dashboard</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
</div>
@endif

View File

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