This repository has been archived by the owner on Oct 10, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from kontenta/featrure/UserAccountWidget
user account widget
- Loading branch information
Showing
10 changed files
with
73 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<section data-kontour-widget="userAccount"> | ||
<span>{{ $user->getDisplayName() }}</span> | ||
<form action="{{ route('kontour.logout') }}" method="post"> | ||
{{ csrf_field() }} | ||
<button type="submit">Logout</button> | ||
</form> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Kontenta\KontourSupport\Widgets; | ||
|
||
use Illuminate\Contracts\Auth\Access\Authorizable; | ||
use Illuminate\Support\Facades\Auth; | ||
use Illuminate\Support\Facades\View; | ||
use Kontenta\Kontour\Contracts\UserAccountWidget as UserAccountWidgetContract; | ||
|
||
class UserAccountWidget implements UserAccountWidgetContract | ||
{ | ||
public function toHtml() | ||
{ | ||
$user = Auth::guard(config('kontour.guard'))->user(); | ||
return View::make('kontour::widgets.userAccount', compact('user'))->render(); | ||
} | ||
|
||
public function isAuthorized(Authorizable $user = null): bool | ||
{ | ||
return (bool) $user; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters