jrrxvillareal
jrrxvillareal

Reputation: 35

Laravel 6 version using compact

What does Laravel 6 version using a

return view(view: 'index', data: compact(varname: 'string'));

I was following a tutorial, but the one I downloaded it seems it's different codes on the tutorial and always gets me an error. I downloaded a Laravel 6.11.0 version. I'm a beginner on this framework hope there's someone could understand and I want to learn about this laravel framework.

here is the tutorial link

https://www.youtube.com/watch?v=98ChVWjI6KI&list=PLpzy7FIRqpGC8Jk6gyWdSVdxCVXZAsenQ&index=5

Upvotes: 0

Views: 91

Answers (1)

Marcin Nabiałek
Marcin Nabiałek

Reputation: 111869

You should just use:

return view('index', compact('string'));

Those view:, data: and varname: are parameter name hints from PHPStorm IDE and not the actual code.

Upvotes: 2

Related Questions