filmov
tv
Part 29 - Authentication User Experience [How to Build a Blog with Laravel 5 Series]

Показать описание
We have our authentication working now, and in this video we learn how to modify our user experience based on whether or not the current user is logged in or logged out.
If the user is logged in we will show our dropdown menu and if they are logged out we will display a simple button to login.
We use blade @if statements and our new Auth::check() helper to see if the user is logged in. If they are logged in then our Auth::check() will return true and execute the if statement, otherwise it will execute the else statement.
We will put the HTML needed for our dropdown in the first if statement clause, and we will put the button to login in the else clause.
To finish up our tutorial we want to make a customary friendly notification when the user is logged in. We will have the logged in menu say "Hello Name". To do this, we take advantage of our second helper Auth::user() and then we just access the property for each column name in the user database table.
Coming Up:
Forgot my Password functionality in our authentication tutorial.
--- CODE SNIPPETS ---
See if current user is logged in
Auth::check()
Get Logged in User's Info (returns null if not logged in)
Auth::user()
--- DOWNLOAD SOURCE CODE ---
--- MORE FROM THIS SERIES ---
--- FOLLOW ME ---
Subscribe for New Releases!
(ask me questions!)
--- QUESTIONS? ---
Leave a comment below and I or someone else can help you.
For quick questions you may also want to ask me on Twitter, I respond almost immediately.
Thanks for all your support!
---
Tags: Laravel 5.2 Framework Tutorial Easy to learn. Best tut about Laravel. Build a blog with Laravel Tutorial. Beginner tutorial. How to video. PHP framework easy best tutorial. Laravel 5 coding in PHP with Alex.
If the user is logged in we will show our dropdown menu and if they are logged out we will display a simple button to login.
We use blade @if statements and our new Auth::check() helper to see if the user is logged in. If they are logged in then our Auth::check() will return true and execute the if statement, otherwise it will execute the else statement.
We will put the HTML needed for our dropdown in the first if statement clause, and we will put the button to login in the else clause.
To finish up our tutorial we want to make a customary friendly notification when the user is logged in. We will have the logged in menu say "Hello Name". To do this, we take advantage of our second helper Auth::user() and then we just access the property for each column name in the user database table.
Coming Up:
Forgot my Password functionality in our authentication tutorial.
--- CODE SNIPPETS ---
See if current user is logged in
Auth::check()
Get Logged in User's Info (returns null if not logged in)
Auth::user()
--- DOWNLOAD SOURCE CODE ---
--- MORE FROM THIS SERIES ---
--- FOLLOW ME ---
Subscribe for New Releases!
(ask me questions!)
--- QUESTIONS? ---
Leave a comment below and I or someone else can help you.
For quick questions you may also want to ask me on Twitter, I respond almost immediately.
Thanks for all your support!
---
Tags: Laravel 5.2 Framework Tutorial Easy to learn. Best tut about Laravel. Build a blog with Laravel Tutorial. Beginner tutorial. How to video. PHP framework easy best tutorial. Laravel 5 coding in PHP with Alex.
Комментарии