I'm pretty new to Laravel and I'm trying to pass data from my controller to the view, which I managed to do as follows:
Controller:
$data['value1'] = 1;
return view('main', $data);
main.blade.php:
{{value1}}
This works fine but now my question is what can I do if I want to change the value of value1
with another method of the controller without refreshing the page?
Are there different approaches or is there one which is most used in Laravel?
Thanks in advance.