Global variable in laravel not working after upgrading 7 to 8

  laravel, php

I upgraded the laravel from 7 to 8 and it works very well except for the global variables.
this is my sample:

View::composer('*', function ($view) {
    $contact = AppContact::all();
    $topbar = AppTopbar::orderBy('sortorder', 'asc')->get();



you can find this code in official docs:

Source: Laravel

Leave a Reply