I have made a list query that populates my drop down box. I have tried var_dump on the controllers part and it all went well, but whenever I tried to call my function on my blade template, it would return me an error: Undefined variable: categories (View: C:\wamp\www\airlines\app\views\content\onewayflight.blade.php)
What seems to be the problem here?
OnewayflightController.php
public function onewayflight()
{
$categories = DB::table('oneways')->lists('destination-from');
return View::make('content.onewayflight')->with('destination-from', $categories);
}
onewayflight.blade.php
{{ Form::select('destination-from', $categories) }}
routes.php
Route::get('flight/onewayflight','OnewayflightController@onewayflight');