Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add welcome panel that is visible only directly after the login #232

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public function __construct()
*/
protected function authenticated(Request $request, $user)
{
session()->flash('login', true);
if ($request->wantsJson()) {
return response()->json(['redirect' => $this->redirectTo], 200);
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<body class="font-sans bg-grey-lighter h-full">
<div id="app" class="flex flex-col min-h-full">
@include ('layouts.nav')

@includeWhen (Auth::user() && Session::has('login'),'layouts.welcome_panel')
<div class="container mx-auto flex flex-1">
<div class="flex flex-1">
@section('sidebar')
Expand Down
9 changes: 9 additions & 0 deletions resources/views/layouts/welcome_panel.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div class="bg-blue-dark py-4">
<div class="container mx-auto flex justify-between items-center text-blue-lightest pl-6">
<div>
<h1 class="font-normal text-2xl">
Welcome, {{ auth()->user()->name }}!
</h1>
</div>
</div>
</div>