从布局中的多个视图中获取@section

I have the following code in my master.blade layout:

<div id="wrapper">
    
    @yield('loginpopup')
  
    <div id="content-component">
        @yield('content')
    </div>  
  
  </div>

This in my view, test-page.blade.php

@extends('layouts.master')

@section('content')
<div id="test-name"></div>
@endsection

This in my view, login-popup.blade.php

@extends('layouts.master')

@section('loginpopup')
<div class="login_popup"></div>

@endsection

When I go to mywebsite.com/test-page, I only see the content from test-page.blade loaded correctly. How can I also load the content of popuplogin from login-popup.blade?

I want the login popup to be loaded on every page, without having to create the section in the views for each page.

Thanks.

</div>

Include login-popup.blade.php in every page. You can do that by:

@include('login-popup')

<div id="wrapper">
  <!-- login-popup.blade.php will be added for every page when you call this master blade -->
  @include('login-popup')

  <div id="content-component">
      @yield('content')
  </div>  
</div>

in login popup page keep only html and remove blade's template code extends & section.

<div class="login_popup"></div>