I'm using Laravel 5.2. In routes.php, I have:
Route::get('test', function() {
$events = App\Event::get();
return view('test', $events);
});
In test.blade.php, I have:
<?php print_r($events) ?>
And I get:
ErrorException in ....php line 11: Undefined variable: events (View: .../test.blade.php)
My get() statement is working properly (print_r($events) works in routes.php). Why isn't it getting passed to the blade template?