Skip to content
Advertisement

Using blade components and javascript

I’m using Laravel, and I’m trying to use javascript to fill a list of users. The problem is that each entry of the list is based on a view, which I made in a Blade component:

pro_list_entry.blade.php:

JavaScript

Then I would like to feed all those components to the list using Javascript:

JavaScript

JavaScript

After a little research, I found that what I am trying to do is simply impossible.

Is there any other way to do this? Adding list entries, which are based on a view, and filling their data with javascript? Maybe I’m just not seeing the obvious solution.

Any help?

Thank you.

Advertisement

Answer

You can write your blade as usual like normal and render it using render() function.

In your controller method

JavaScript

In your jquery

JavaScript
Advertisement