Hari Hari - 14 days ago 6
PHP Question

Form in laravel giving out a strange output

Hey there i am very much new to laravel and am starting up with laravel 5, here i am trying to build a simple form in laravel just for some starter's but as i do i.e as i execute the page consisting my simple form in my xampp localhost(windows os) it's giving out raw html output i.e in tags, i am pretty much blank as am just a beginner to this laravel framework, please i need some help over this one pardon me if i went wrong somewere.

Here is routes.php

Route::get('form', function(){
//render app/views/form.blade.php
return View::make('form');
});


Here is form.blade.php

<!--app/views/form.blade.php-->
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>
Laravel
</title>
</head>
<body>
{!! Form::open(array('url'=>'form-submit')) !!}

<!-- email input -->
{{ Form::label('email','Email',array('id'=>'','class'=>'')) }}
{{ Form::email('email','hello@clivern.com',array('id'=>'','class'=>'')) }}
<!-- password inputs -->
{{ Form::label('password','Password',array('id'=>'','class'=>'')) }}
{{ Form::password('password','',array('id'=>'','class'=>'')) }}
<!-- submit buttons -->
{{ Form::submit('Save') }}

{!! Form::close() !!}
</body>
</html>


And this is the output which i get when i run it

<form method="POST" action="http://laravel.dev/form-submit" accept-charset="UTF-8">
<input name="_token" type="hidden" value="nOdrCi1IIwBGx2ofIMfNH2xvI9xSxHGk8m8glBYf">
<label for="email" id="" class="">Email</label>
<input id="" class="" name="email" type="email" value="hello@clivern.com"> <label for="password" id="" class="">Password</label>
<input name="password" type="password" value="" id="password">
<input type="submit" value="Save"> </form>

Answer

Try to use {!! Form::methodHere !!} in your form facade.

Comments