Laravel 5.5 render a React component in a blade view with data from the controller

后端 未结 3 1955
一生所求
一生所求 2021-02-09 11:30

My goals is to be able to do something like this in my blade view.

name }}\" />

But this doesn\'t render any

3条回答
  •  情话喂你
    2021-02-09 12:24

    You can do it like this..

    @extends('layouts.app')
    
    @section('script')
        
    @endsection
    
    @section('content')
        
    @endsection

    But better solution would be AJAX request to some controller that returns json data.

    Best solution for you will this laravel package laracasts/PHP-Vars-To-Js-Transformer

提交回复
热议问题