I wanted to show an acceptance link on each userblock underneath the "Friend Requests" section on the Friends Index page. To avoid writing a new view just for friend-request userblocks, I added @if ($requested = true) @endif to the Friend Index page view. This takes advantage of Blade's if statement to set a variable called $requested to true for each userblock looped through and displayed for the Friend Requests section. I don't think this is proper, but it works for now. I would like to find a better way to do this. Perhaps compare the $user with the $requests array, if $requests is set, and put the link within this if statement?
I wanted to show an acceptance link on each userblock underneath the "Friend Requests" section on the Friends Index page. To avoid writing a new view just for friend-request userblocks, I added
@if ($requested = true) @endif
to the Friend Index page view. This takes advantage of Blade's if statement to set a variable called $requested to true for each userblock looped through and displayed for the Friend Requests section. I don't think this is proper, but it works for now. I would like to find a better way to do this. Perhaps compare the $user with the $requests array, if $requests is set, and put the link within this if statement?