How to pick specific item On the laravel blade

0

How do I get a specific item in Laravel blade ?

Example:

$(document).ready(function(){
var id = 1;
    $('body').append('{{ $projeto->'+id+'->name}}'
})
<body>
   Deve Aparecer aqui o nome do projeto
</body>
    
asked by anonymous 12.11.2018 / 12:49

1 answer

0

I do not know if I understand very well, but if you want to pass the name of the project that is configured in the Laravel .ENV file just use the helper:

{{config ('app.name', 'Laravel')}}

Insert this anywhere in your view blade

To set the project name, go to the root of the project and open the .ENV file, the first line will be "APP_NAME", if necessary, change this line to whatever you wish and it will automatically appear in your view.

Abc

    
12.11.2018 / 20:24