Where clause get nothing & (local.ERROR: Undefined variable: meeting) even if defined

Where clause get nothing & (local.ERROR: Undefined variable: meeting) even if defined

讲师或客户想通过 jitsi-meet 加入管理员之前创建的会议。但是当有人试图加入时,这个 ->

"local.ERROR: Undefined variable: meeting"

显示错误。

I var_dump $jitsimeetings 来自 where 子句,但在其中什么也看不到。请有人帮助我。

#型号

<?php
    
    namespace App;
    
    use Illuminate\Database\Eloquent\Factories\HasFactory;
    use Illuminate\Database\Eloquent\Model;
    
    class JitsiMeeting extends Model
    {
    
        protected $table = 'jitsimeetings';
        
        protected $fillable = ['meeting_id', 'owner_id', 'user_id','meeting_title', 'start_time', 'end_time','duration', 'jitsi_url',  'course_id', 'link_by', 'type', 'agenda', 'image'];
    
        public function user()
        {
            return $this->belongsTo('App\User','user_id','id');
        }
    
        public function courses()
        {
            return $this->belongsTo('App\Course','course_id','id');
        }
    }

#控制器

public function joinMeetup($meetingid){
        $userid = Auth::user()->id;
        
        $jitsimeetings = JitsiMeeting::where([
            ['user_id', '=', $userid],
            ['meeting_id', '=', $meetingid]
        ])->get();
        
        return view('admin.jitsimeeting.jitsimeet', compact('jitsimeetings'));
    }

#查看

<?php foreach($jitsimeetings as $key => $meeting){} ?>

<div class="container-fluid">
    <div id='meet'></div>
</div>
<script src='https://meet.jit.si/external_api.js'></script>
<!-- <script src='https://localhost/external_api.js'></script> -->
<script>

const domain = 'meet.jit.si';
const options = {
    roomName: <?php echo $meeting->meeting_id; ?>,
    width: 1250,
    height: 700,
    parentNode: document.querySelector('#meet'),
    userInfo: {
            displayName: '<?php echo $meeting->meeting_title; ?>'
            
        },
    // jwt: '<jwt_token>',
    

    configOverwrite:{
            // doNotStoreRoom: true,
            // startVideoMuted: 0,
            startWithVideoMuted: true,
            startWithAudioMuted: true,
            // liveStreamingEnabled: true
            // desktopSharingFrameRate: {
            // min: 5,
            // max: 5
            // },
            enableWelcomePage: false,
            prejoinPageEnabled: false,
            enableSaveLogs: false,
            enableNoisyMicDetection: true
            // disableRemoteMute: false
            
        },
    interfaceConfigOverwrite: {
            // filmStripOnly: false,
            SHOW_JITSI_WATERMARK: false,
            SHOW_WATERMARK_FOR_GUESTS: false,
            SHOW_BRAND_WATERMARK: false,
            SHOW_POWERED_BY: false
            //  DEFAULT_REMOTE_DISPLAY_NAME: 'New User'
            // TOOLBAR_BUTTONS: []
        }
};
const api = new JitsiMeetExternalAPI(domain, options);
api.executeCommand('subject', '<?php echo $meeting->meeting_title; ?>');

</script>

你一开始就关闭了foreach所以

    <!-- <script src='https://localhost/external_api.js'></script> -->

    <script>

 @foreach($jitsimeetings as $key => $meeting)

    <div class="container-fluid">
        <div id='meet'></div>
    </div>
  

        const domain = 'meet.jit.si';
        const options = {
            roomName:'{{$meeting->meeting_id}}' ,
            width: 1250,
            height: 700,
            parentNode: document.querySelector('#meet'),
            userInfo: {
                displayName: '{{$meeting->meeting_title}}'

            },
            // jwt: '<jwt_token>',


            configOverwrite:{
                // doNotStoreRoom: true,
                // startVideoMuted: 0,
                startWithVideoMuted: true,
                startWithAudioMuted: true,
                // liveStreamingEnabled: true
                // desktopSharingFrameRate: {
                // min: 5,
                // max: 5
                // },
                enableWelcomePage: false,
                prejoinPageEnabled: false,
                enableSaveLogs: false,
                enableNoisyMicDetection: true
                // disableRemoteMute: false

            },
            interfaceConfigOverwrite: {
                // filmStripOnly: false,
                SHOW_JITSI_WATERMARK: false,
                SHOW_WATERMARK_FOR_GUESTS: false,
                SHOW_BRAND_WATERMARK: false,
                SHOW_POWERED_BY: false
                //  DEFAULT_REMOTE_DISPLAY_NAME: 'New User'
                // TOOLBAR_BUTTONS: []
            }
        };
        const api = new JitsiMeetExternalAPI(domain, options);
        api.executeCommand('subject', '{{$meeting->meeting_title}}');

    </script>
    @endforeach