10 months ago

Beginner : Passed var from controller to a vue

Posted 10 months ago by andre0ani


I'm beginning. I tried to print some var on a vue. I get these var from a controller, like this : public function infos() { $arch = php_uname(); $phpversion = phpversion(); $mailAdmin = $_SERVER['SERVER_ADMIN'];

return view('home', [
    'host' => $host,

I have this in my web.php : Route::get('/', ['as' => 'home', function() { return view('home'); }]);

And in the view home :

{{ $arch }}

But I have the error var not defined. I don't know how to passed them to the view. Any help please ?

Thanks in advance,


Please sign in or create an account to participate in this conversation.