Question: I am new in Laravel. I include Header using @include('header'). but I want to hide profile menu when user is not register. How can I do ?
I use this to get data from table directly in blade.php

```
$array = App\Table::Select(users)->get(); 

```

Answer: 
You can use the [`Auth` facade](https://laravel.com/docs/8.x/authentication#determining-if-the-current-user-is-authenticated) to determine if the current user is logged in:

header.blade.php

```
@if(Illuminate\Support\Facades\Auth::check())
    <!-- profile menu -->
@endif

```

##### Edit: You can use blade directives except the `@if` to checking user is authenticated or not. like the following:

```
@auth
    <!-- Profile Menu -->
@endauth

```

If you—for whatever reason— just want to know if some user is registered, change your query to the following:

```
@if(Profile::find($userId) !== null)
    <!-- profile menu -->
@endif

```
Simple use this

```
   if(Auth::user())
      include('header')
   endif

```