laravel blade syntax for loop how to call iteration index inside laravel helper functions - laravel

I have the following for loop
#for($i = 0; $i < $contactAmount; $i++)
<div class="form-group row">
<label for="firstname" class="col-md-4 col-form-label text-md-right">voornaam</label>
<div class="col-md-6">
<input id="firstname" type="text" class="form-control #error('firstname.0') is-invalid #enderror" name="firstname[]" value="{{ old('firstname.0') }}" autofocus>
#error('firstname.0')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
#endfor
but if I replace the hard coded '0' with {{ $i }} my validation does not work anymore. So how do I call my integer and use it inside laravel helper functions?
#for($i = 0; $i < $contactAmount; $i++)
<div class="form-group row">
<label for="firstname" class="col-md-4 col-form-label text-md-right">voornaam</label>
<div class="col-md-6">
<input id="firstname" type="text" class="form-control #error('firstname.{{ $i }}') is-invalid #enderror" name="firstname[]" value="{{ old('firstname.'. $i) }}" autofocus>
#error('firstname.{{ $i }}')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
#endfor

Why don't you use a #foreach? You can access the index of the loop as follows:
#foreach($contactAmount as $amount)
<div class="form-group row">
{{ $loop->iteration }}
...
</div>
#endforeach

Related

Login form in Laravel is giving the error 419 Page Expired

It used to work somoothly, then I added Sociallite and then it some point it broke the default login with email and password.
Now every time I login with username and password I get the error "419 Page Expired" and it's literally diving me crazy because I have tried everything, with no luck.
View login.blade.php:
<form method="POST" action="{{ route('login') }}">
#csrf
<div class="form-group row">
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control #error('email') is-invalid #enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
#error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
<div class="form-group row">
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control #error('password') is-invalid #enderror" name="password" required autocomplete="current-password">
#error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
<div class="form-group row">
<div class="col-md-6 offset-md-4">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}>
<label class="form-check-label" for="remember">
{{ __('Remember Me') }}
</label>
</div>
</div>
</div>
<div class="form-group row mb-0">
<div class="col-md-8 offset-md-4">
<button type="submit" class="btn btn-primary">
{{ __('Login') }}
</button>
#if (Route::has('password.request'))
<a class="btn btn-link" href="{{ route('password.request') }}">
{{ __('Forgot Your Password?') }}
</a>
#endif
</div>
</div>
</form>
Route web.php:
Route::post('login', [
'as' => '',
'uses' => 'Auth\LoginController#login'
]);
I searched the web and found some ppl talking about clearing cash, clearing cookies, checking cash and storage permissions, clearing SESSION_DOMAIN and I did all, but it's still the same.
Please anyone is still facing such issue in Larvel 7?

Laravel - htmlspecialchars() expects parameter 1 to be string, array given (View: in input field

In my Laravel-5.8 project consisting of Sales application, I have this codes:
Controller:
public function create()
{
$suppliers =Supplier::all();
$categories = Category::all();
$taxes = Tax::all();
$units = Unit::all();
return view('product.create', compact('categories','taxes','units','suppliers'));
}
public function store(Request $request)
{
$request->validate([
'name' => 'required|min:3|unique:products|regex:/^[a-zA-Z ]+$/',
'serial_number' => 'required',
'model' => 'required|min:3',
'category_id' => 'required',
'sales_price' => 'required',
'unit_id' => 'required',
'image' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048',
'tax_id' => 'required',
]);
$product = new Product();
$product->name = $request->name;
$product->serial_number = $request->serial_number;
$product->model = $request->model;
$product->category_id = $request->category_id;
$product->sales_price = $request->sales_price;
$product->unit_id = $request->unit_id;
$product->tax_id = $request->tax_id;
if ($request->hasFile('image')){
$imageName =request()->image->getClientOriginalName();
request()->image->move(public_path('images/product/'), $imageName);
$product->image = $imageName;
}
$product->save();
foreach($request->supplier_id as $key => $supplier_id){
$supplier = new ProductSupplier();
$supplier->product_id = $product->id;
$supplier->supplier_id = $request->supplier_id[$key];
$supplier->price = $request->supplier_price[$key];
$supplier->save();
}
return redirect()->back()->with('message', 'Product Created Successfully');
}
view
<div class="row mt-2">
<div class="clearix"></div>
<div class="col-md-10">
<div class="tile">
<h3 class="tile-title">Product</h3>
<div class="tile-body">
#if ($errors->any())
<div class="alert alert-danger">
<ul>
#foreach ($errors->all() as $error)
<li>{{ $error }}</li>
#endforeach
</ul>
</div>
#endif
<form method="POST" action="{{route('product.store')}}" enctype="multipart/form-data">
#csrf
<div class="row">
<div class="form-group col-md-6">
<label class="control-label">Product Name</label>
<input name="name" class="form-control #error('name') is-invalid #enderror" type="text" placeholder="Product Name">
#error('name')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
<div class="form-group col-md-6">
<label class="control-label">Serial Number</label>
<input name="serial_number" class="form-control #error('serial_number') is-invalid #enderror" type="number" placeholder="Enter Tax Name">
#error('serial_number')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
<div class="form-group col-md-6">
<label class="control-label">Model</label>
<input name="model" class="form-control #error('name') is-invalid #enderror" type="text" placeholder="Enter Tax Name">
#error('model')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
<div class="form-group col-md-6">
<label class="control-label">Category</label>
<select name="category_id" class="form-control">
<option>---Select Category---</option>
#foreach($categories as $category)
<option value="{{$category->id}}">{{$category->name}}</option>
#endforeach
</select>
#error('category_id')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
<div class="form-group col-md-6">
<label class="control-label">Sale Price</label>
<input name="sales_price" class="form-control #error('sales_price') is-invalid #enderror" type="number" placeholder="Enter Tax Name">
#error('sales_price')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
<div class="form-group col-md-6">
<label class="control-label">Unite</label>
<select name="unit_id" class="form-control">
<option>---Select Unit---</option>
#foreach($units as $unit)
<option value="{{$unit->id}}">{{$unit->name}}</option>
#endforeach
</select>
#error('unit_id')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
<div class="form-group col-md-6">
<label class="control-label">Image</label>
<input name="image" class="form-control #error('image') is-invalid #enderror" type="file" >
#error('image')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
<div class="form-group col-md-6">
<label class="control-label">Tax </label>
<select name="tax_id" class="form-control">
<option>---Select Tax---</option>
#foreach($taxes as $tax)
<option value="{{$tax->id}}">{{$tax->name}} %</option>
#endforeach
</select>
#error('tax_id')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
<div class="tile">
<div id="example-2" class="content">
<div class="group row">
<div class="form-group col-md-5">
<select name="supplier_id[]" class="form-control">
<option>Select Supplier</option>
#foreach($suppliers as $supplier)
<option value="{{$supplier->id}}">{{$supplier->name}} </option>
#endforeach
</select>
</div>
<div class="form-group col-md-5">
<input name="supplier_price[]" value="{{old('supplier_price')}}" class="form-control #error('supplier_price') is-invalid #enderror" type="number" placeholder="Enter Sales Price">
<span class="text-danger">{{ $errors->has('additional_body') ? $errors->first('body') : '' }}</span>
</div>
<div class="form-group col-md-2">
<button type="button" id="btnAdd-2" class="btn btn-primary float-right"><i class="fa fa-plus"></i></button>
<button type="button" class="btn btn-danger btnRemove float-right"><i class="fa fa-trash"></i></button>
</div>
</div>
</div>
</div>
<div class="form-group col-md-4 align-self-end">
<button class="btn btn-primary" type="submit"><i class="fa fa-fw fa-lg fa-check-circle"></i>Update</button>
</div>
</form>
</div>
</div>
</div>
</div>
When I submitted the form, I got this error:
htmlspecialchars() expects parameter 1 to be string, array given (View:...
Then when I removed this:
value="{{old('supplier_price')}}"
from:
<div class="form-group col-md-5">
<input name="supplier_price[]" value="{{old('supplier_price')}}" class="form-control #error('supplier_price') is-invalid #enderror" type="number" placeholder="Enter Sales Price">
<span class="text-danger">{{ $errors->has('additional_body') ? $errors->first('body') : '' }}</span>
</div>
the error vanished.
I wanted to use it for the input field to retain its value after any error in validation. Where did I get it wrong and how do I correct it?
Thank you
supplier_price is an array since you define it as name="supplier_price[]"
your old() function will output an array while the mustache function {{}} expects a string.
If I understand your code properly you should be better off removing the [] from name="supplier_price[]"

syntax error, unexpected 'layouts' (T_STRING), expecting ')' (View: C:\xampp7\htdocs\shopping\resources\views\auth\register.blade.php)

ican not open to page "register.blade.php" when I click to register itt alert this error
syntax error, unexpected 'layouts' (T_STRING), expecting ')' (View: C:\xampp7\htdocs\shopping\resources\views\auth\register.blade.php) I can open page login.blade.php
my code in app.blade.php::
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
#if (Route::has('register'))
<li class="nav-item">
<a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
</li>
#endif
There is a problem with your Register helper function, you are missing ')
<button type="submit" class="btn btn-primary">
{{ __('Register}}
</button>
Change to
<button type="submit" class="btn btn-primary">
{{ __('Register')}}
</button>
register.blade.php::
#extends('layouts.app')
#section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">{{ __('Register') }}</div>
<div class="card-body">
<form method="POST" action="{{ route('register') }}">
#csrf
<div class="form-group row">
<label for="name" class="col-md-4 col-form-label text-md-right">{{ __('Name') }}</label>
<div class="col-md-6">
<input id="name" type="text" class="form-control #error('name') is-invalid #enderror" name="name" value="{{ old('name') }}" required autocomplete="name" autofocus>
#error('name')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
<div class="form-group row">
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control #error('email') is-invalid #enderror" name="email" value="{{ old('email') }}" required autocomplete="email">
#error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
<div class="form-group row">
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control #error('password') is-invalid #enderror" name="password" required autocomplete="new-password">
#error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
<div class="form-group row">
<label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label>
<div class="col-md-6">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password">
</div>
</div>
<div class="form-group row mb-0">
<div class="col-md-6 offset-md-4">
<button type="submit" class="btn btn-primary">
{{ __('Register}}
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
#endsection

How to show data after user click an option from drop down list?

I want to show the data after user have selected the project.
I've tried several method but none of them can show the next data.
I want to create as simple as when user choose a project, it'll show the next question such as select product, select period, etc.
this is my form.blade.php
#extends('layouts.master')
#section('style')
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<link rel="stylesheer" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
.box{
width:600px;
margin:0 auto;
border:1[x solid #ccc;]
}
</style>
#endsection
#section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card">
<div class="card-header">Add Prospect</div>
<form action="{{ url('/add/outlet') }}" method="post" enctype="multipart/form-data">
#csrf
<div class="card-body">
<div class="form-group">
<select name="project_name" id="project" class="form-control input-lg dynamic" data-dependent="product">
<option value="">Select Project</option>
#foreach($project_list as $project)
<option value="{{$project->project}}"> {{$project->project}} </option>
#endforeach
</select>
</div>
<div class="form-group">
<select name="product_name" id="product" class="form-control input-lg">
<option value="">Select Product</option>
<option value="HelloBill Retail">HelloBill Retail</option>
<option value="HelloBill FNB">HelloBill FNB</option>
</select>
</div>
<div class="form-group">
<select name="period" id="period" class="form-control input-lg">
<option value="">Select Period</option>
<option value="Bulanan">Bulanan</option>
<option value="Tahunan">Tahunan</option>
</select>
</div>
<div class="form-group row">
<label for="outlet" class="col-md-4 col-form-label text-md-left">Outlet</label>
<div class="col-md-8">
<input id="outlet" type="text" class="form-control{{ $errors->has('outlet') ? ' is-invalid' : '' }}" name="outlet" value="{{ old('outlet') }}" required autofocus>
#if ($errors->has('outlet'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('outlet') }}</strong>
</span>
#endif
</div>
</div>
<div class="form-group row">
<label for="alamat" class="col-md-4 col-form-label text-md-left">Alamat</label>
<div class="col-md-8">
<input id="addressLine1" type="text" class="form-control{{ $errors->has('addressLine1') ? ' is-invalid' : '' }}" name="addressLine1" value="{{ old('addressLine1') }}" placeholder="Address Line #1" required autofocus>
#if ($errors->has('addressLine1'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('addressLine1') }}</strong>
</span>
#endif
</div>
</div>
<div class="form-group row">
<label for="name" class="col-md-4 col-form-label text-md-left"></label>
<div class="col-md-8">
<input id="addressLine2" type="text" class="form-control" name="addressLine2" value="{{ old('addressLine2') }}" placeholder="Address Line #2" required autofocus>
</div>
</div>
<div class="form-group row">
<label for="kelurahan" class="col-md-4 col-form-label text-md-left"></label>
<div class="col-md-8">
<input id="kelurahan" type="text" class="form-control{{ $errors->has('kelurahan') ? ' is-invalid' : '' }}" name="kelurahan" value="{{ old('kelurahan') }}" placeholder="Kelurahan" required autofocus>
#if ($errors->has('kelurahan'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('kelurahan') }}</strong>
</span>
#endif
</div>
</div>
<div class="form-group row">
<label for="kecamatan" class="col-md-4 col-form-label text-md-left"></label>
<div class="col-md-8">
<input id="kecamatan" type="text" class="form-control{{ $errors->has('kecamatan') ? ' is-invalid' : '' }}" name="kecamatan" value="{{ old('kecamatan') }}" placeholder="Kecamatan" required autofocus>
#if ($errors->has('kecamatan'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('kecamatan') }}</strong>
</span>
#endif
</div>
</div>
<div class="form-group row">
<label for="kota" class="col-md-4 col-form-label text-md-left"></label>
<div class="col-md-8">
<input id="kota" type="text" class="form-control{{ $errors->has('kota') ? ' is-invalid' : '' }}" name="kota" value="{{ old('kota') }}" placeholder="Kota" required autofocus>
#if ($errors->has('kota'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('kota') }}</strong>
</span>
#endif
</div>
</div>
<div class="form-group row">
<label for="provinsi" class="col-md-4 col-form-label text-md-left"></label>
<div class="col-md-8">
<input id="provinsi" type="text" class="form-control{{ $errors->has('provinsi') ? ' is-invalid' : '' }}" name="provinsi" value="{{ old('provinsi') }}" placeholder="Provinsi" required autofocus>
#if ($errors->has('provinsi'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('provinsi') }}</strong>
</span>
#endif
</div>
</div>
<div class="form-group row">
<label for="zipCode" class="col-md-4 col-form-label text-md-left"></label>
<div class="col-md-8">
<input id="zipCode" type="text" class="form-control{{ $errors->has('zipCode') ? ' is-invalid' : '' }}" name="zipCode" value="{{ old('zipCode') }}" placeholder="Kode Pos" required autofocus>
#if ($errors->has('zipCode'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('zipCode') }}</strong>
</span>
#endif
</div>
</div>
<div class="form-group row">
<label for="PIC" class="col-md-4 col-form-label text-md-left">PIC</label>
<div class="col-md-8">
<input id="PIC" type="text" class="form-control{{ $errors->has('PIC') ? ' is-invalid' : '' }}" name="PIC" value="{{ old('PIC') }}" required autofocus>
#if ($errors->has('PIC'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('PIC') }}</strong>
</span>
#endif
</div>
</div>
<div class="form-group row">
<label for="email" class="col-md-4 col-form-label text-md-left">Email</label>
<div class="col-md-8">
<input id="email" type="text" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required autofocus>
#if ($errors->has('email'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('email') }}</strong>
</span>
#endif
</div>
</div>
<div class="form-group row mb-0">
<div class="col-md-6 offset-md-4">
<button type="submit" class="btn btn-primary">
Add
</button>
</div>
</div>
#if($errors->any())
<div class="category-msg-error">{{ $errors->first() }}</div>
#endif
</div>
</form>
</div>
</div>
</div>
</div>
#endsection
#section('extra')
<script>
$(document).ready(function(){
$('.dynamic').change(function(){
if($(this).val()!=''){
var select = $(this).attr("id");
var value = $(this).val();
var dependent = $(this).data('dependent');
var __token = $('input[name=_token"]').val();
$.ajax({
url:"{{route('dynamicdependent.fetch')}}",
method:"POST",
data:{select:select, value:value, _token:_token,
dependent=dependent},
success:function(result){
$('#+dependent').html(result);
}
})
}
});
});
</script>
#endsection
please help. and i am also new in Laravel
There are two mistakes:-
In ajax request data you are setting dependent=dependent that should be dependent: dependent.
In Success response, you are setting this $('#+dependent').html(result); but that is not correct. It should be this $('#'+dependent).html(result);
Below is the full jQuery code:
<script>
$(document).ready(function(){
$('.dynamic').change(function(){
if($(this).val()!=''){
var select = $(this).attr("id");
var value = $(this).val();
var dependent = $(this).data('dependent');
var __token = $('input[name=_token"]').val();
$.ajax({
url:"{{route('dynamicdependent.fetch')}}",
method:"POST",
data:{
select:select,
value:value,
_token:_token,
dependent:dependent
},
success:function(result){
$('#'+dependent).html(result);
}
});
}
});
});
</script>
Please check and let me know if that will not help. I will try to solve your problem.

Laravel Auth not working after moving to remove

I have moved my local laravel Application to Production. On my local pc the register function work's well (using Laravel Auth). On the remote host nothing happeds when I submit the register form. No validation error or something else. What is wrong with my application?
I got an 404 while the process. Here my register routes:
Route::get('register', 'Auth\RegisterController#showRegistrationForm')->name('register');
Route::post('register', 'Auth\RegisterController#register');
Here the content of my register.blade.php file:
<form id="js-validation-signup" action="{{ route('register') }}" method="post">
#csrf
<div class="py-3">
<div class="form-group">
<input type="text"
class="form-control form-control-lg form-control-alt{{ $errors->has('first_name') ? ' is-invalid' : '' }}"
id="first_name" name="first_name" placeholder="{{ __('First Name') }}"
value="{{ old('first_name') }}" autocomplete="off">
#if ($errors->has('first_name'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('first_name') }}</strong>
</span>
#endif
</div>
<div class="form-group">
<input type="text"
class="form-control form-control-lg form-control-alt{{ $errors->has('name') ? ' is-invalid' : '' }}"
id="name" name="name" placeholder="{{ __('Name') }}"
value="{{ old('name') }}" autocomplete="off">
#if ($errors->has('name'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('name') }}</strong>
</span>
#endif
</div>
<div class="form-group">
<input type="email"
class="form-control form-control-lg form-control-alt{{ $errors->has('email') ? ' is-invalid' : '' }}"
id="email" name="email" placeholder="{{ __('E-Mail Address') }}"
autocomplete="off" value="{{ old('email') }}">
#if ($errors->has('email'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('email') }}</strong>
</span>
#endif
</div>
<div class="form-group">
<input type="password"
class="form-control form-control-lg form-control-alt{{ $errors->has('password') ? ' is-invalid' : '' }}"
id="password" name="password" placeholder="{{ __('Password') }}">
#if ($errors->has('password'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('password') }}</strong>
</span>
#endif
</div>
<div class="form-group">
<input type="password" class="form-control form-control-lg form-control-alt"
id="password_confirmation" name="password_confirmation"
placeholder="{{ __('Confirm Password') }}">
</div>
<div class="form-group">
<div class="input-group">
<input class="form-control form-control-lg form-control-alt{{ $errors->has('application_name') ? ' is-invalid' : '' }}"
id="application_name"
name="application_name" type="text"
placeholder="{{ __('Application Name') }}" autocomplete="off"
value="{{ old('application_name') }}">
<div class="input-group-append">
<span class="input-group-text input-group-text-alt">.example.com</span>
</div>
#if ($errors->has('application_name'))
<span class="invalid-feedback" role="alert">
<strong>{{ $errors->first('application_name') }}</strong>
</span>
#endif
</div>
</div>
<div class="form-group">
<div class="custom-control custom-checkbox custom-control-primary">
<input type="checkbox" class="custom-control-input" id="signup-terms"
name="signup-terms">
<label class="custom-control-label" for="signup-terms">I agree to Terms &
Conditions</label>
</div>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-block btn-hero-lg btn-hero-primary">
<i class="fa fa-fw fa-user-plus mr-1"></i> Sign Up
</button>
<p class="mt-3 mb-0 d-lg-flex justify-content-lg-between">
<a class="btn btn-sm btn-light d-block d-lg-inline-block mb-1" href="#">
<i class="fa fa-book text-muted mr-1"></i> Read Terms
</a>
</p>
</div>
</form>
I think i had the same problem with login here.
my problem was that I used Laravel's auth login and inside Auth/LoginController has a
use AuthenticatesUsers which uses a trait that is inside vendor and Auth folder and when I wanted to use git clone to get the project on another computer and used composer install to install the used packages for the project my vendor changed to default and all the login code which was in AuthenticatesUsers trait removed and changed to default
The route() function is for named routes.
It seems that you named your get route but didn't do that with the corresponding post route. Accessing route('register') with a POST method will result in a 404 error.
Try to name the post route as well or use action('Auth\RegisterController#register')
<form id="js-validation-signup" action="{{action('Auth\RegisterController#register')}}" method="post">

Resources