error when updating table (crud) in laravel - html

When I get ready to edit the table I get the following error:
"The POST method is not supported for this route. Supported methods:
GET, HEAD."
<?php
Route::get('/crear',[
'uses'=>'CarController#mostrar',
'as'=>'cars.create'
]
);
Route::post('/crear',[
'uses'=>'CarController#crear',
'as'=>'cars.crear'
]);
Route::get('/', 'CarController#casa' );
Route::post('cars/{id?}/editar', 'CarController#edit')->name('editarcar');
Route::post('cars/{id?}/editar', 'CarController#update');
Auth::routes();
Route::get('/home', 'HomeController#index')->name('home');
Route::resource('cars', 'CarController');
In View
#extends('layouts.app')
#section('title', 'Contact')
#section('content')
<div class="container col-md-8 col-md-offset-2">
<div class="well well bs-component">
<form class="form-horizontal" method="post">
#foreach ($errors->all() as $error)
<div class="alert alert-danger">{{ $error }}</div>
#endforeach
#if(session('status'))
<div class="alert alert-success">
{{ session('status') }}
</div>
#endif
{!! csrf_field() !!}
<fieldset>
<legend>Editar </legend>
<div class="form-group">
<label for="patente" class="col-lg-label">patente</label>
<div class="col-lg-10">
<input type="text" name="patente"size="6" maxlength="6" class="form-control"required>
</div>
</div>
<div class="form-group">
<label for="marca" class="col-lg-label">marca</label>
<div class="col-lg-10">
<input type="text" name="marca" class="form-control" required>
</div>
</div>
<div class="form-group">
<label for="modelo" class="col-lg-label">modelo</label>
<div class="col-lg-10">
<input type="text" name="modelo" class="form-control" required>
</div>
</div>
<div class="form-group">
<label for="color" class="col-lg-label">color</label>
<div class="col-lg-10">
<input type="text" name="color" class="form-control" required>
</div>
</div>
<div class="form-group">
<div class="col-lg-10 col-lg-offset-2">
<button class="btn btn-default">Cancelar</button>
<button type="submit" class="ntm btn-primary">Actualizar</button>
</div>
</div>
</fieldset>
</form>
</div>
</div>
#endsection
Controller
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
namespace App\Http\Controllers;
use App\Car;
use Illuminate\Http\Request;
public function edit($id)
{
$car = car::whereid($id)->firstOrFail();
return view('edit', compact('cars'));
}
public function update(Request $request, $id)
{
$car = car::whereid($id)->firstOrFail();
$car->patente = $request->post('patente');
$car->marca = $request->post('marca');
$car->modelo = $request->post('modelo');
$car->color = $request->post('color');
$car->save();
return redirect(action('CarsController#edit', $car->id))->with('status', 'El car ' . $id . ' ha sido actualizado');
}

Update your controller > edit action with correct variable compact.
public function edit($id)
{
$car = car::whereid($id)->firstOrFail();
return view('edit', compact('car'));
}
Add a form action like {{ route("cars.update", ['car' => $car->id]) }} so your view looks like:
#extends('layouts.app')
#section('title', 'Contact')
#section('content')
<div class="container col-md-8 col-md-offset-2">
<div class="well well bs-component">
<form class="form-horizontal" action="{{ route("cars.update") }}" method="post">
#foreach ($errors->all() as $error)
<div class="alert alert-danger">{{ $error }}</div>
#endforeach
#if(session('status'))
<div class="alert alert-success">
{{ session('status') }}
</div>
#endif
{!! csrf_field() !!}
<fieldset>
<legend>Editar </legend>
<div class="form-group">
<label for="patente" class="col-lg-label">patente</label>
<div class="col-lg-10">
<input type="text" name="patente"size="6" maxlength="6" class="form-control"required>
</div>
</div>
<div class="form-group">
<label for="marca" class="col-lg-label">marca</label>
<div class="col-lg-10">
<input type="text" name="marca" class="form-control" required>
</div>
</div>
<div class="form-group">
<label for="modelo" class="col-lg-label">modelo</label>
<div class="col-lg-10">
<input type="text" name="modelo" class="form-control" required>
</div>
</div>
<div class="form-group">
<label for="color" class="col-lg-label">color</label>
<div class="col-lg-10">
<input type="text" name="color" class="form-control" required>
</div>
</div>
<div class="form-group">
<div class="col-lg-10 col-lg-offset-2">
<button class="btn btn-default">Cancelar</button>
<button type="submit" class="ntm btn-primary">Actualizar</button>
</div>
</div>
</fieldset>
</form>
</div>
</div>
#endsection

Related

Html elements shrinking after add FORM tag

I don't really understand the elements changes after add FORM.
Any suggestion?
BEFORE
AFTER add
{!! Form::model($user, ['method' => 'POST','route' => ['profile.update', $user->id], 'enctype' => 'multipart/form-data']) !!}
Full codes here:(
#include('Navigation.navbarhome')
<div class="container">
{!! Form::model($user, ['method' => 'POST','route' => ['profile.update', $user->id], 'enctype' => 'multipart/form-data']) !!}
#if ($message = Session::get('success'))
<div class="alert alert-success">
{{ session()->get('success') }}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</div>
#endif
#if ($errors->any())
<div class="alert alert-danger">
<strong>Whoops!</strong> There were some problems with your input.<br><br>
<ul>
#foreach ($errors->all() as $error)
<li>{{ $error }}</li>
#endforeach
</ul>
</div>
#endif
<h1>Edit Profile</h1>
<hr>
<div class="row">
<!-- left column -->
<div class="col-md-3">
<div class="text-center">
<img src="/uploads/avatars/{{ Auth::user()->profImage }}" class="avatar img-circle" alt="avatar">
<h6>Upload your photo...</h6>
<input type="file" name="profImage">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
</div>
</div>
<!-- edit form column -->
<div class="col-md-7 personal-info">
<h3>Personal info</h3>
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="col-lg-3 control-label">First name:</label>
<div class="col-lg-8">
<input class="form-control" name="fname" type="text" value="{{$user->fname}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Last name:</label>
<div class="col-lg-8">
<input class="form-control" name="lname" type="text" value="{{$user->lname}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Staff ID:</label>
<div class="col-lg-8">
<input class="form-control" name="StaffID" type="text" value="{{$user->StaffID}}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Email:</label>
<div class="col-lg-8">
<input class="form-control" name="email" type="text" value="{{$user->email}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Department:</label>
<div class="col-lg-8">
<input class="form-control" name="dept" type="text" value="{{$user->department1->name}}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Position:</label>
<div class="col-lg-8">
<input class="form-control" name="role" type="text" value="{{$user->position->name}}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label"></label>
<div class="col-md-8">
<input type="submit" class="btn btn-primary" value="Save Changes">
<span></span>
<a href="/home2"> <input type="button" href="/home2" class="btn btn-default" value="Cancel">
</div>
</div>
</form>
{!! Form::close() !!}
</div>
</div>
</div>
<hr>
This is occurring because there's already an existing <form> element within your code, and nesting these elements is causing issues within the styling.
You should be able to address it by simply changing your inner <form> element into a <div> since it isn't doing much except for handling styling (via the form-horizontal class).
Just change the following line from:
<form class="form-horizontal" role="form">
to:
<div class="form-horizontal" role="form">
Example (with changes applied)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<!-- This element is added by Laravel -->
<form>
<h1>Edit Profile</h1>
<hr>
<div class="row">
<!-- left column -->
<div class="col-md-3">
<div class="text-center">
<img src="" class="avatar img-circle" alt="avatar">
<h6>Upload your photo...</h6>
<input type="file" name="profImage">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
</div>
</div>
<!-- edit form column -->
<div class="col-md-7 personal-info">
<h3>Personal info</h3>
<!-- Change this to a <form> to reproduce your original issue -->
<div class="form-horizontal" role="form">
<div class="form-group">
<label class="col-lg-3 control-label">First name:</label>
<div class="col-lg-8">
<input class="form-control" name="fname" type="text" value="{{$user->fname}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Last name:</label>
<div class="col-lg-8">
<input class="form-control" name="lname" type="text" value="{{$user->lname}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Staff ID:</label>
<div class="col-lg-8">
<input class="form-control" name="StaffID" type="text" value="{{$user->StaffID}}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Email:</label>
<div class="col-lg-8">
<input class="form-control" name="email" type="text" value="{{$user->email}}">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Department:</label>
<div class="col-lg-8">
<input class="form-control" name="dept" type="text" value="{{$user->department1->name}}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">Position:</label>
<div class="col-lg-8">
<input class="form-control" name="role" type="text" value="{{$user->position->name}}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label"></label>
<div class="col-md-8">
<input type="submit" class="btn btn-primary" value="Save Changes">
<span></span>
<input type="button" href="/home2" class="btn btn-default" value="Cancel">
</div>
</div>
</div>
</div>
</div>
<hr>
</form>
</div>

data not updating on laravel 5.4?

Here is my edit.blade file.Please notice on From tag action attribute.Is this Ok?
#extends('admin_theme.master')
#section('title','Add Category')
#section('content')
#if(Auth::check())
<script>
function validselect(){
var ind=document.getElementById('my_select').selectedIndex;
if(ind==0){
alert("please select an Valid Option");
}
}
</script>
<div class="forms">
<div class=" form-grids form-grids-right">
<div class="widget-shadow " data-example-id="basic-forms">
<div class="form-title">
<h4>Ready To ADD:</h4>
</div>
<div class="form-body">
<form class="form-horizontal" action={{route('category.update',$singledata->id)}} method="put">
{{ csrf_field() }}
<div class="form-group">
<label for="inputEmail3" class="col-sm-2 control-label">Category Name</label>
<div class="col-sm-9">
<input class="form-control" id="inputEmail3" placeholder="Name" type="text" value="{{$singledata->name}}" name="name">
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-2 control-label">Status</label>
<div class="col-sm-9">
<Select class="form-control" id="my_select"onchange="validselect()" name="status">
<option>Select availability</option>
<option value="1" #if($singledata->status==1){{"selected"}} #endif >Active</option>
<option value="0" #if($singledata->status==0){{"selected"}} #endif>DeActive</option>
</Select>
</div>
</div>
<div class="form-group">
</div>
<div class="col-sm-offset-2"> <button type="submit" class="btn btn-default" >Update</button>
</div>
</form>
</div>
</div>
</div>
</div>
#endif
#endsection
Here is my update method in controller and here the inputted data from edit page not found in $request object.I changed the html method like as PUT or PATCH but no luck :)
public function update(Request $request, $id)
{
$allinput=$request->all();
// dd($allinput);
// dd($allinput);
$data=Category::findorfail($id);
$data->update($allinput);
return view('admin_theme.dynamic_files.category.allCategory');
}
here is my route
<?php
Route::get('/', function () {
return view('my_theme.index');
});
Auth::routes();
Route::get('/admin', 'HomeController#index');
Route::resource('category','CategoryController');
In before (doing CRUD) the store() method works fine the problem is when i update data...i am stuck on this,please help me on this.Thanks in advance
Atlast solved
adding method="POST" in form tag and also add below line after {{csrf_field()}}
<input name="_method" type="hidden" value="PATCH">
but why this line need ?dont know.If anyone make me understand i will be thankfull :)

MethodNotAllowedHttpException laravel 5.4

try to make a simple insert but i get this error MethodNotAllowedHttpException in RouteCollection.php (line 251) at RouteCollection->methodNotAllowed(array('GET', 'HEAD', 'PUT', 'PATCH', 'DELETE')) in RouteCollection.php (line 238)
this is my form in the view
<form method="post" action="{{route('product.create')}}" class="form-horizontal" enctype="multipart/form-data">
{!! csrf_field() !!}
<fieldset>
<!-- Text input-->
<div class="form-group">
<label class="col-md-3 control-label" for="name">Name</label>
<div class="col-md-9">
<input id="name" name="name" type="text" placeholder="Product name" class="form-control input-md">
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="textarea">Description</label>
<div class="col-md-9">
<textarea class="form-control" id="textarea" name="description"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="size">Size</label>
<div class="col-md-9">
<select class="form-control" id="size">
<option selected>Choose size...</option>
<option value="small">Small</option>
<option value="medium">Medium</option>
<option value="larg">Larg</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="category_id">Category</label>
<div class="col-md-9">
<select class="form-control" id="category_id">
<option selected>Choose Categories...</option>
{{--<option value= "$categories"></option>--}}
<option value= "1"> men </option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="image">Image</label>
<div class="col-md-9">
<input id="file" name="image" class="input-file" type="file">
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label" for="submit"></label>
<div class="col-md-9">
<button id="submit" name="submit" class="btn btn-primary">Create</button>
</div>
</div>
</fieldset>
</form>
my route
Route::group(['prefix'=>'admin','middleware'=>'auth'],function(){
Route::get('/' ,function(){
return view('admin.index');
})->name('admin.index');
});
Route::resource('product','ProductsController');
Route::resource('category','CategoriesController');
my controller
public function create()
{
$categories = Category::pluck('name','id');
return view('admin.product.create',compact('categories'));
}
public function store(Request $request)
{
$formInput = $request->except('image');
$image = $request->image;
if($image){
$imageName = $image->getClientOriginalName();
$image->move('images', $imageName);
$formInput['image']=$imageName;
}
Product::create($formInput);
return redirect()->route('admin.index');
}
any help will be appreciated
should be:
action="{{route('product.store')}}"
The route product.create expects GET header for showing a register form
i forget to add name to the form now after adding name i get alle field except image
I tried all above answers and still had this problem. So I found out that my model was requiring the "fillable" property:
protected $fillable = ['name', 'status', 'etc','etc2'];
This solved the issue and now I can post/put/delete.
Also, in my routes file instead of using one route to each action, I simply use, for example:
Route::resource('user', 'v1\UserController');

Laravel 5.4 UnexpectedValueException in Response.php line 444 in form submition

I am making multiauth. When I submit admin email and password from admin login view I got bellow error
"UnexpectedValueException in Response.php line 444:
The Response content must be a string or object implementing __toString(), "boolean" given."
here is my form
#extends('layouts.app')
#section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Admin Login</div>
<div class="panel-body">
<form class="form-horizontal" role="form" method="POST" action="{{ route('admin.login.submit') }}">
{{ csrf_field() }}
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="col-md-4 control-label">E-Mail Address</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required autofocus>
#if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
#endif
</div>
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password" class="col-md-4 control-label">Password</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control" name="password" required>
#if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
#endif
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<div class="checkbox">
<label>
<input type="checkbox" name="remember" {{ old('remember') ? 'checked' : '' }}> Remember Me
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-md-8 col-md-offset-4">
<button type="submit" class="btn btn-primary">
Login
</button>
<a class="btn btn-link" href="{{ route('password.request') }}">
Forgot Your Password?
</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
#endsection
And here is route
Route::prefix('admin')->group(function (){
Route::post('/login', 'Auth\AdminLoginController#login')->name('admin.login.submit');
});
And the controller is here
<?php
namespace App\Http\Controllers\Auth;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class AdminLoginController extends Controller
{
public function __construct()
{
$this->middleware('guest');
}
public function showLoginForm()
{
return view('admin.auth.login');
}
public function login(Request $request)
{
return true;
}
}
What wrong here?
And How can I solve it?
Thanks in advance.
I found that problem. that was in my controller. Exactly in login function. I returened true. Here is the problem. When I return 1 then it worked.

Laravel : Form not submitting but everything looks right?

I have a very strange problem with Laravel . I'm sure I miss something but not sure what.
When submit there's no record in DB. But it's very strange that not submit even without validator. Here is the code.
The model:
use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
class Registration extends Eloquent implements UserInterface, RemindableInterface {
use UserTrait, RemindableTrait;
/**
* The database table used by the model.
*
* #var string
*/
protected $table = 'register';
protected $fillable = array('first_name','middle_name','last_name','address','phone','email','age','growth','weight','shoe_size','cloth_size','languages','eye_color');
}
The Controller :
<?php
class RegistrationController extends BaseController {
public function getAgency() {
return View::make('agency');
}
public function postAgency(){
$rules = array(
'first_name' => 'required',
'middle_name' => 'required',
'last_name' =>'required',
'address' => 'required',
'phone' => 'required',
'email' => 'required|email',
'age' => 'required',
'growth' =>'required',
'weight' => 'required',
'shoe_size' => 'required',
'cloth_size' => 'required',
'languages' => 'required',
'eye_color' => 'required'
);
$validator = Validator::make(Input::all(),$rules);
if ($validator->fails()) {
return Redirect::to('/agency')->withErrors($validator)->withInput();
}
else {
$registration = new Registration;
$registration->first_name = Input::get('first_name');
$registration->middle_name = Input::get('middle_name');
$registration->last_name = Input::get('last_name');
$registration->address = Input::get('address');
$registration->phone = Input::get('phone');
$registration->email = Input::get('email');
$registration->age = Input::get('age');
$registration->growth = Input::get('growth');
$registration->weight = Input::get('weight');
$registration->shoe_size = Input::get('shoe_size');
$registration->cloth_size = Input::get('cloth_size');
$registration->languages = Input::get('languages');
$registration->eye_color = Input::get('eye_color');
$registration->save();
return Redirect::to('/agency')->with('global',"Thank You!");
}
}
}
The View (agency.blade.php):
#extends('layouts.main')
#section('content')
<div class="container">
<div class="stepwizard">
<div class="stepwizard-row setup-panel">
<div class="stepwizard-step">
1
<p><img src="images/leftShoe.png" alt="" class="shoes"></p>
</div>
<div class="stepwizard-step">
2
<p><img src="images/rightShoe.png" alt="" class="shoes"></p>
</div>
<div class="stepwizard-step">
3
<p><img src="images/duoShoes.png" alt="" class="shoes"></p>
</div>
</div>
</div>
<form method="POST" action="{{URL::action('agency-post')}}">
<div class="row setup-content" id="step-1">
<div class="col-md-12">
<button class="btn btn-primary nextBtn btn-lg pull-right" type="button" >Next</button>
</div>
</div>
<div class="row setup-content" id="step-2">
<div class="col-xs-12">
<div class="col-md-12">
<div class="form-group">
<label>First Name</label>
<input type="text" id="name" class="form-control" name="first_name" placeholder="First Name">
#if ($errors->has('first_name')) <p class="help-block">{{ $errors->first('first_name') }}</p> #endif
</div>
<div class="form-group">
<label >Middle Name</label>
<input type="text" id="name" class="form-control" name="middle_name" placeholder="Middle Name">
#if ($errors->has('middle_name')) <p class="help-block">{{ $errors->first('middle_name') }}</p> #endif
</div>
<div class="form-group">
<label >Last Name</label>
<input type="text" id="name" class="form-control" name="last_name" placeholder="Last Name">
#if ($errors->has('last_name')) <p class="help-block">{{ $errors->first('last_name') }}</p> #endif
</div>
<div class="form-group">
<label >Address</label>
<input type="text" id="name" class="form-control" name="address" placeholder="Address">
#if ($errors->has('address')) <p class="help-block">{{ $errors->first('address') }}</p> #endif
</div>
<div class="form-group">
<label >Phone</label>
<input type="text" id="name" class="form-control" name="phone" placeholder="Phone">
#if ($errors->has('phone')) <p class="help-block">{{ $errors->first('phone') }}</p> #endif
</div>
<div class="form-group">
<label >Email</label>
<input type="email" id="email" class="form-control" name="email" placeholder="super#cool.com">
#if ($errors->has('email')) <p class="help-block">{{ $errors->first('email') }}</p> #endif
</div>
<div class="form-group">
<label >Age</label>
<input type="text" id="email" class="form-control" name="age" placeholder="Age">
#if ($errors->has('age')) <p class="help-block">{{ $errors->first('age') }}</p> #endif
</div>
<div class="form-group">
<label >Growth</label>
<input type="text" id="email" class="form-control" name="growth" placeholder="Growth">
#if ($errors->has('growth')) <p class="help-block">{{ $errors->first('growth') }}</p> #endif
</div>
<div class="form-group">
<label >Weight</label>
<input type="text" id="email" class="form-control" name="weight" placeholder="Weight">
#if ($errors->has('weight')) <p class="help-block">{{ $errors->first('weight') }}</p> #endif
</div>
<div class="form-group">
<label >Shoe size</label>
<input type="text" id="email" class="form-control" name="shoe_size" placeholder="Shoe size">
#if ($errors->has('shoe_size')) <p class="help-block">{{ $errors->first('shoe_size') }}</p> #endif
</div>
<div class="form-group">
<label >Size Clothing</label>
<input type="text" id="email" class="form-control" name="cloth_size" placeholder="Cloth Size">
#if ($errors->has('cloth_size')) <p class="help-block">{{ $errors->first('cloth_size') }}</p> #endif
</div>
<div class="form-group">
<label >Spoken Languages</label>
<input type="text" id="email" class="form-control" name="languages" placeholder="Spoken Languages">
#if ($errors->has('languages')) <p class="help-block">{{ $errors->first('languages') }}</p> #endif
</div>
<div class="form-group">
<label >Eye Color</label>
<input type="text" id="email" class="form-control" name="eye_color" placeholder="Eye Color">
#if ($errors->has('eye_color')) <p class="help-block">{{ $errors->first('eye_color') }}</p> #endif
</div>
<div class="form-group">
<button class="btn btn-primary nextBtn btn-lg pull-right" type="button" >Next</button>
</div>
</div>
</div>
<div class="row setup-content" id="step-3">
<div class="col-xs-12">
<div class="col-md-12">
<h3> Additional Information</h3>
<div class="form-group">
<label class="control-label">Skills</label>
<textarea maxlength="500" class="form-control" rows="5" placeholder="Enter your skills"></textarea>
</div>
<div class="form-group">
<label class="control-label">Additional Information</label>
<textarea maxlength="500" type="text" class="form-control" rows="5" placeholder="Enter additional information for you"></textarea>
</div>
{{Form::token()}}
{{Form::submit('Finish!')}}
</div>
</div>
</div>
Route.php
Route::get('/agency',array(
'as' => 'agency',
'uses' => 'RegistrationController#getAgency'
));
Route::post('/agency',array(
'as' => 'agency-post',
'uses' => 'RegistrationController#postAgency'
));
It's more strange that when write in loop $validator->fails() { return 'fails';}
page only reload nothing happens.