If I understand you correctly, you have a controller working, and you want to pass a variable to the views? If this is the case, using the "with" method on the view() should work.. look at the section called "Passing Data To Views" on http://laravel.com/docs/master/views
It says:
// Using conventional approach
$view = view('greeting')->with('name', 'Victoria');
// Using Magic Methods
$view = view('greeting')->withName('Victoria');
So, in your case, inside of your controller, you would want to do:
return view('info')->with('myteam', 'Team Name');
This will expose the $myteam variable to the views that are called.
Thanks Gercoli, that's it!
No criticism of anyone involved but there's something about the Laravel documentation and even the screencasts which isn't quite right for me as a true MVC novice. Since your reply I've found this guide which I have found to be the most accessible and well explained to give me a 'way in' to Laravel: http://daylerees.com/codebright/responses
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community