marfan40 shows us how to create some helpers (functions) to avoid repeating code between some views.

Laravel custom helper