Summer Sale! All accounts are 50% off this week.

adamjhn's avatar

Do you know why it appears "expression expected" error?

Do you know why appears an error "expression expected" in the code below?

        @section('scripts')
        <script src="{{ asset('js/tinymce/js/tinymce/tinymce.min.js')}}" </script>
       
        <script type="text/javascript">
    
        var certificate = {};
        @foreach($conference->registrationTypes as $registrationType)
                @if(!$registrationType->certificate)
            certificate[{{ $registrationType->id }}] = '';
        @else
            certificate[{{ $registrationType->id }}] = '{!!   $registrationType->certificate->content !!}';
        @endif
    
       @endforeach
        </script>
       @stop 

0 likes
1 reply
Tray2's avatar

Wild guess but I think you need to have the array key wrapped in single quotes.

Please or to participate in this conversation.