Laravel: route with parameters

1

I have a school system with a call screen where it has a button that opens a modal with a form to choose the class and the date (% with%). This form will redirect to a screen with the list of students in the class chosen to launch the call on the day you selected earlier.

How do I set up a route that accepts something like chamadas/index ?

Even though there is a way that the parameters do not appear in the url for me, it already works.

Thank you in advance.

    
asked by anonymous 21.08.2017 / 01:47

1 answer

1

As simple as possible, example :

Route::get('chamadas/{turma}/{data}', "ChamadasController@index");

in your class controller

class ChamadasController 
{
    public function index($turma, $data)
    {
         // ... code
    }
}

Your url would be this:

http://site.com/chamadas/1/21-08-2017

21.08.2017 / 01:54