This code works, however in my learning of Laravel, I want to know if using Blade+Laravel syntax, can be better implemented
https://laravel.com/docs/5.5/blade#loops
I would suggest using a for loop instead of a while loop in this case:
@for ($i = 1; $i <= (5 - $post->images->count()); $i++) @endfor