Posts Pass PHP data to javascript on Laravel blade view
Post
Cancel

Pass PHP data to javascript on Laravel blade view

1
2
3
4
5
6
7
//src - https://stackoverflow.com/a/31201101

@section('content')

var participantsfrom = {!! json_encode($activity->participantsfrom) !!};

//then variable #participantsfrom# is accessible from your JS

with addon - https://github.com/laracasts/PHP-Vars-To-Js-Transformer/blob/master/readme.md

origin - https://www.pipiscrew.com/?p=16562 pass-php-data-to-javascript-on-laravel-blade-view

This post is licensed under CC BY 4.0 by the author.
Contents

Trending Tags