O'Reilly logo

Mastering Laravel by Christopher John Pecoraro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Our example

If we want to create a form to reserve a room in our accommodation, we can easily call a route from our controller:

/**
 * Show the form for creating a new resource.
 *
 * @return Response
 */
public function create()
{
    return view('auth/reserve');
}

Now we need to create a new view that is located at resources/views/auth/reserve.blade.php.

In this view, we can create a form to reserve a room in an accommodation where the user can select the start date, which comprises of the start day of the month and year, and the end date, which also comprises of the start day of the month and year:

Our example

The form would begin as before, with a POST to reserve-room ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required