1

Mrs. good morning I'd like to config my Laravel initial route, to works on the /, I don't know how I can to do to use the controller.

I use at this moment redirecting my initial route to /start route, but I'd like to use on / only.

See my router below.

Route::controller("Start");
Route::controller("Search");
Route::controller("Contact");

Route::get('/', function()
{
    return Redirect::to("start");
});

I'd like to make:

Route::get('/', function()
{
    return View::make("start.index");
});

And pass the Start.php controller to this view, it's possible?

Can somebody help me with?

Paulo Teixeira
  • 448
  • 5
  • 11

1 Answers1

3
Route::get('/', 'StartController@index');

looks like what you're after: https://laravel.com/docs/5.2/routing

You can also call it using an array, to pass additional params:

Route::get('/', ['as' => 'start', 'uses' => 'StartController@index']);
Damien Pirsy
  • 25,319
  • 8
  • 70
  • 77