How to Handle Laravel error messages in vue? - laravel

I know I did something wrong here, but how do you handle error messages of Laravel in vue template?... is there a way of bypassing the #error of the laravel Blade templating
this is the vue component file (fileComponent.vue)
<template>
<div class="row my-2">
<div class="col-md-2 font-weight-bold pt-2">Grade:</div>
<div class="col-md-10">
<select name="grade" class="form-control #error('grade') is-invalid #enderror" v-model="selected_grade" #change="onChange($event)">
<option v-for="grade in grading" :key="grade.id" :value="grade.name">{{grade.name}}</option>
</select>
#error('grade')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
<div class="row my-3" v-if="subjects !== null">
<div class="col-md-3">
<div class="card shadow">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold">Subjects:</h6>
</div>
<div class="card-body">
<div class="custom-control custom-checkbox" v-for="subject in subjects" :key="subject.id">
<input type="checkbox" class="custom-control-input #error('subjects') is-invalid #enderror" name="subjects[]" :id="subject.name" :value="subject.name"/>
<label class="custom-control-label" :for="subject.name">{{subject.name}}</label>
</div>
#error('subjects')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
</div>
</div>
</div>
</div>
</template>
This is Shown on the page instead of error message

Related

Laravel 8 Image source not readable, on Intervention Image resize (Shared hosting)

I'm using Laravel 8. I was working on my machine (locally), after deploying it on the Shared hosting (my case Bluehost), I have moved the project to the root of my hosting, And I created a subdomain to my Laravel project, and I moved the public folders file to the subdomain folder.
I have executed the php artisan storage:link, everything works fine, even the images are uploaded, but the problem is when I use the Intervention Image to resize the image it shows
Intervention\Image\Exception\NotReadableException
Image source not readable
The code:
$imageName = $request['image']->store('uploads/brand', 'public');
Intervention\Image\Facades\Image::make(public_path("storage/{$imageName}"))->fit(1024, 1024)->save();
I have tried some solutions, but no result, the error kept the same
The solutions that I tried:
1- config/filesystems.php
'links' => [
base_path('/public_html/storage') => storage_path('app/public'),
],
2- I tried to specify the public path manually.
3- https://stackoverflow.com/a/39971026/5862126
the error is
Intervention\Image\Exception\NotWritableException
Can't write image data to path (/home4/ctwotec3/laravel_market/public/uploads/4386300.jpg)
Edited 1:
HTML Form code
#extends('layouts.app')
#section('content')
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="container">
<form action="/brand" enctype="multipart/form-data" method="POST">
{{ csrf_field() }}
<div class="card">
<div class="card-header">
<h1 class="text-center">New Brand</h1>
</div>
<div class="card-body">
<div class="col-10 offset-1">
{{-- Name English --}}
<div class="row">
<div class="row mb-3">
<label for="name_en" class="col-md-4 col-form-label text-md-end">Name English</label>
<div class="col-md-6">
<input id="name_en" type="text"
class="form-control #error('name_en') is-invalid #enderror" name="name_en"
value="{{ old('name_en') }}" autocomplete="name_en" autofocus>
#error('name_en')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
</div>
{{-- Name Kurdish --}}
<div class="row">
<div class="row mb-3">
<label for="name_ku" class="col-md-4 col-form-label text-md-end">Name Kurdish</label>
<div class="col-md-6">
<input id="name_ku" type="text"
class="form-control #error('name_ku') is-invalid #enderror" name="name_ku"
value="{{ old('name_ku') }}" autocomplete="name_ku" autofocus>
#error('name_ku')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
</div>
{{-- Name Arabic --}}
<div class="row">
<div class="row mb-3">
<label for="name_ar" class="col-md-4 col-form-label text-md-end">Name Arabic</label>
<div class="col-md-6">
<input id="name_ar" type="text"
class="form-control #error('name_ar') is-invalid #enderror" name="name_ar"
value="{{ old('name_ar') }}" autocomplete="name_ar" autofocus>
#error('name_ar')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
</div>
{{-- Single image --}}
<div class="row">
<div class="row mb-3">
<label for="image"
class="col-md-4 col-form-label text-md-end">{{ __('Item image') }}</label>
<div class="col-md-6">
<input id="chooseFile" type="file" class="form-control" name="image" #error('image')
is-invalid #enderror accept=".jpg,.jpeg,.png">
#error('image')
<strong style="color: red">{{ $message }}</strong>
#enderror
</div>
</div>
</div>
</div>
</div>
</div>
<div class="d-flex justify-content-center">
<button class="btn btn-primary mt-3 mb-3 float-end w-75 ">submit</button>
</div>
</form>
</div>
#endsection
Edited 2: here is the path of the uploaded image on the server, that the Intervention Image can't read it
/home4/ctwotec3/laravel_market/public/storage/uploads/brand/r0kBFdXcxCg59WKIwmNsIwq16g30mWs4LZLxWSeT.jpg

Missing required parameter for [Route: password.reset] [URI: reset-password/{token}]

Im trying to implement the fortify authentication.
When I want to reset the password it opens the route: reset-password. When I open the link it gives me an error message:
Missing required parameter for [Route: password.reset] [URI: reset-password/{token}]
i'm using the following versions:
php 8.0.2
Laravel Framework 8.32.1
npm 6.17.11
Anyone able to help me out with this ?
FortifyServiceProvider.php:
Fortify::loginView(function(){
return view( view: 'auth.login');
});
Fortify::registerView(function(){
return view( view: 'auth.register');
});
Fortify::requestPasswordResetLinkView(function(){
return view( view: 'auth.forgot-password');
});
Fortify::resetPasswordView(function($request){
return view('auth.reset-password', ['token' => $request]);
});
reset-password.blade.php
#extends('template')
#section('content')
<div class="container">
<div class="card login-card">
<div class="row no-gutters">
<div class="col-md-5">
<img src="/img/login.jpg" alt="login" class="login-card-img">
</div>
<div class="col-md-7">
#if ($errors->any())
#foreach ($errors->all() as $error)
<h1>{{ $error }}</h1>
#endforeach
#endif
#error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
<div class="card-body">
<div class="brand-wrapper">
<img src="/img/logo.png" alt="logo" class="logo">
</div>
<p class="login-card-description">Reset password</p>
<form method="POST" action="{{ route('password.reset') }}">
#csrf
<input type="hidden" name="token" value="{{$request->route('token')}}">
<div class="form-group">
<label for="email" class="sr-only">Email</label>
<input type="email" name="email" id="email" class="form-control"
placeholder="Email address" value="{{request->email}}">
#error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
<div class="form-group mb-4">
<label for="password" class="sr-only">Password</label>
<input id="password" type="password" class="form-control #error('password') is-invalid #enderror" name="password" required autocomplete="new-password" placeholder="Password">
#error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
<div class="form-group mb-4">
<label for="password" class="sr-only">Password</label>
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password" placeholder="Confirm password">
</div>
<input name="login" id="login" class="btn btn-block login-btn mb-4" type="submit" value="Update">
</form>
<p class="login-card-footer-text">Don't have an account? <a href="{{ route('register') }}"
class="text-reset">Register here</a></p>
<nav class="login-card-footer-nav">
Terms of use.
Privacy policy
</nav>
</div>
</div>
</div>
</div>
#endsection
forgot-password.blade.php
#extends('template')
#section('content')
<div class="container">
<div class="card login-card">
<div class="row no-gutters">
<div class="col-md-5">
<img src="/img/login.jpg" alt="login" class="login-card-img">
</div>
<div class="col-md-7">
#if ($errors->any())
#foreach ($errors->all() as $error)
<h1>{{ $error }}</h1>
#endforeach
#endif
#error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
<div class="card-body">
<div class="brand-wrapper">
<img src="/img/logo.png" alt="logo" class="logo">
</div>
<p class="login-card-description">Reset password</p>
#if(session('status'))
{{session('status')}}
#endif
<form method="POST" action="{{ route('password.request') }}">
#csrf
<div class="form-group">
<label for="email" class="sr-only">Email</label>
<input type="email" name="email" id="email" class="form-control"
placeholder="Email address">
#error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
<input name="login" id="login" class="btn btn-block login-btn mb-4" type="submit" value="Reset">
</form>
<p class="login-card-footer-text">Don't have an account? <a href="{{ route('register') }}"
class="text-reset">Register here</a></p>
<nav class="login-card-footer-nav">
Terms of use.
Privacy policy
</nav>
</div>
</div>
</div>
</div>
#endsection
register.blade.php
#extends('template')
#section('content')
<div class="container">
<div class="card login-card">
<div class="row no-gutters">
<div class="col-md-5">
<img src="/img/login.jpg" alt="login" class="login-card-img">
</div>
<div class="col-md-7">
<div class="card-body">
<div class="brand-wrapper">
<img src="/img/logo.png" alt="logo" class="logo">
</div>
<p class="login-card-description">Register a new account</p>
<form method="POST" action="{{ route('register') }}">
#csrf
<div class="form-group">
<label for="name" class="sr-only">Name</label>
<input id="name" type="text" class="form-control #error('name') is-invalid #enderror" name="name" value="{{ old('name') }}" required autocomplete="name" autofocus placeholder="Name">
</div>
#error('name')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
<div class="form-group">
<label for="email" class="sr-only">Email</label>
<input id="email" type="email" class="form-control #error('email') is-invalid #enderror" name="email" value="{{ old('email') }}" required autocomplete="email" placeholder="Email address">
#error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
<div class="form-group mb-4">
<label for="password" class="sr-only">Password</label>
<input id="password" type="password" class="form-control #error('password') is-invalid #enderror" name="password" required autocomplete="new-password" placeholder="Password">
#error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
<div class="form-group mb-4">
<label for="password" class="sr-only">Password</label>
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password" placeholder="Confirm password">
</div>
<input name="register" id="register" class="btn btn-block login-btn mb-4" type="submit" value="Register">
</form>
Forgot password?
<p class="login-card-footer-text">Alredy have an account? Login here</p>
<nav class="login-card-footer-nav">
Terms of use.
Privacy policy
</nav>
</div>
</div>
</div>
</div>
</div>
#endsection
login.blade.php
#extends('template')
#section('content')
<div class="container">
<div class="card login-card">
<div class="row no-gutters">
<div class="col-md-5">
<img src="/img/login.jpg" alt="login" class="login-card-img">
</div>
<div class="col-md-7">
#if($errors->any())
#foreach ($errors->all() as $error)
<h1>{{ $error }}</h1>
#endforeach
#endif
#error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
<div class="card-body">
<div class="brand-wrapper">
<img src="/img/logo.png" alt="logo" class="logo">
</div>
<p class="login-card-description">Sign into your account</p>
<form method="POST" action="{{ route('login') }}">
#csrf
<div class="form-group">
<label for="email" class="sr-only">Email</label>
<input type="email" name="email" id="email" class="form-control" placeholder="Email address">
#error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
<div class="form-group mb-4">
<label for="password" class="sr-only">Password</label>
<input type="password" name="password" id="password" class="form-control" placeholder="***********">
#error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
<input name="login" id="login" class="btn btn-block login-btn mb-4" type="submit" value="Login">
</form>
Forgot password?
<p class="login-card-footer-text">Don't have an account? Register here</p>
<nav class="login-card-footer-nav">
Terms of use.
Privacy policy
</nav>
</div>
</div>
</div>
</div>
#endsection
template.blade.php
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script>
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
</head>
<body>
<div id="app">
<main class="d-flex align-items-center min-vh-100 py-3 py-md-0">
#yield('content')
</main>
</div>
</body>
</html>
In reset-password.blade.php change the route password.reset to password. update like below
<form method="POST" action="{{ route('password.update') }}">
and this
<input type="email" name="email" id="email" class="form-control"
placeholder="Email address" value="{{request->email}}">
to this
<input type="email" name="email" id="email" class="form-control"
placeholder="Email address" value="{{$request->email}}">
you were missing the $ in request->email
change this ['token' => $request] to ['request' => $request] like below
Fortify::resetPasswordView(function($request){
return view('auth.reset-password', ['token' => $request]);
});
Hope it works

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

Laravel: cascading model login and registration using bootstrap

I am trying to make a cascaded login and registration model using bootstrap.
when I click on sign in button the model pop up which is fine but login field is not working. Registration button is working. Again click on Login button the fields appear. Here is the screenshots and code
<a href="#" class="nav-link" data-toggle="modal" data-target="#exampleModal">
<img src="public/img/sign-in-icon.png" class="img-sign-in img-responsive"></a></li>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<!-- Nav tabs -->
<ul class="nav nav-tabs md-tabs tabs-2">
<li class="active">
<a class="nav-link active" data-toggle="tab" href="#login-form" role="tab"><i class="fas fa-user mr-1"></i>
Login</a>
</li>
<li>
<a class="nav-link" data-toggle="tab" href="#registration-form" role="tab"><i class="fas fa-user-plus mr-1"></i>
Register</a>
</li>
</ul>
<!--
<li class="nav-item">
Register
</li> -->
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="tab-content">
<div id="login-form" class="tab-pane fade in active">
<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>
</div>
<div id="registration-form" class="tab-pane fade">
<form action="/">
<div class="form-group">
<label for="name">Your Name:</label>
<input type="text" class="form-control" id="name" placeholder="Enter your name" name="name">
</div>
<div class="form-group">
<label for="newemail">Email:</label>
<input type="email" class="form-control" id="newemail" placeholder="Enter new email" name="newemail">
</div>
<div class="form-group">
<label for="newpwd">Password:</label>
<input type="password" class="form-control" id="newpwd" placeholder="New password" name="newpwd">
</div>
<button type="submit" class="btn btn-default">Register</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
Does anybody please know, what is wrong with the code?

Resources