laravel 7 pass variable to all views code example Example: laravel load view in variable $html = view('users.edit', compact('user'))->render();