User Registraton – Create Form

For the registration we need a registration form. As you know we keep our html files in views directory, so we will create a file in views directory.

create

I have created a file create.blade.php in app/views/user/ directory. You should know about the laravel blade templates and laravel blade syntax.

We will put our registration form html code in this file.

Here is the code for create.blade.php file.

In laravel blade we have defined the action of the form as

{{ Form::open(array(‘url’ => ‘user/createUser’)) }}

which is equivalent to http://localhost:8000/user/createUser.

In laravel default method for the form is POST. You can change the form method like this

{{ Form::open(array(‘url’ => ‘user/createUser’,’method’ => ‘GET’)) }}

 

Now we have created our form but we need to see it on browser. For that we will have to do some code in route.php file.

Now if we open http://localhost:8000/user/register we can see our form. It should look like this

registration form
registration form

 

So now, In our next post we will save our records in database.

Share this article: