I was trying to do include with Laravel blade, but the problem is it can't pass the variable. Here's my example code:
file_include.blade.php
<?php $myvar = "some text"; main.blade.php
@include('file_include') {{$myvar}} When I run the file, it return the error "Undefined variable: myvar". So, how can I pass the variable from the include file to the main file?
Thank you.