Hi @van-india !
First of all you're using the Auth::user() to get the logged in user and taking advantage of being that result being a User Model to query the database to get all users with the given condition. It works, but try to think how wierd that can be for your future self :)
Now about your problem.
I assumed that you have a "Notifications" method in your User's Model that reflects the database connection between those two entities. Also assumed that in the notifications table you have the "message" column, so it will be reflected in you model's instance. The $loop->iteration can be found in the documentation here: https://laravel.com/docs/6.x/blade#the-loop-variable
Check the example.
// Before
@foreach($users as $not)
@foreach ($not->Notifications as $key => $notification)
{{$key+1}}
@endforeach
@endforeach
// After
@foreach($users as $user)
$totalUserNotifications = count($user->Notifications) ;
@foreach ($user->Notifications as $notification)
{{ $loop->iteration }} / {{ $totalUserNotifications }} - {{ $notification->message}}
@endforeach
@endforeach
// Output:
// 1 / 3 - First Notification Message
// 2 / 3 - Second Notification Message
// 3 / 3 - Third Notification Message
i want all the notification display in my blade file so how can i display without auth beacuse i have all the notification display and also count so how can i
Without the Auth you can directly use the User model.
// Assuming your where condition...
$users = User::where('role', '=', 'user')->get();
// Now to get all user's notifications
// Iterate over $users as $user
$user->notifications