Missing required parameter laravel-8 - laravel

I got error Missing required parameter for [Route: battersecondinnings.update] [URI: battersecondinnings/{battersecondinning}] [Missing parameter: battersecondinning]. (View: C:\xampp\htdocs\ContentBaseApp - 1.0.2\resources\views\battersecondinnings\edit.blade.php)
This is my C:\xampp\htdocs\ContentBaseApp - 1.0.2\resources\views\battersecondinnings\edit.blade.php
#extends('layouts.app')
#section('content')
<div class="row">
<div class="col-lg-12 margin-tb">
<div class="pull-left">
<h2>Edit Batter</h2>
</div>
<div class="pull-right">
<a class="btn btn-primary" href="{{ route('battersecondinnings.index') }}"> Back</a>
</div>
</div>
</div>
#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
<form action="{{ route('battersecondinnings.update', $battersecondinnings->id) }}" method="POST" enctype="multipart/form-data">
#csrf
#method('PUT')
<div class="row">
<div class="form-group row">
<div class="col-md-6">
<strong>ব্যাটসম্যান:</strong>
<input type="text" name="name" value="{{ $battersecondinnings->name }}" class="form-control" placeholder="ব্যাটসম্যান">
</div>
</div>
<div class="form-group row">
<div class="col-md-6">
<strong>রান:</strong>
<input type="number" name="runs" value="{{ $battersecondinnings->runs }}" class="form-control" placeholder="রান">
</div>
</div>
<div class="form-group row">
<div class="col-md-6">
<strong>বল:</strong>
<input type="number" name="balls" value="{{ $battersecondinnings->balls }}" class="form-control" placeholder="বল">
</div>
</div>
<div class="form-group row">
<div class="col-md-6">
<strong>ছক্কা:</strong>
<input type="number" name="sixs" value="{{ $battersecondinnings->sixs }}" class="form-control" placeholder="ছক্কা">
</div>
</div>
<div class="form-group row">
<div class="col-md-6">
<strong>চার:</strong>
<input type="number" name="fours" value="{{ $battersecondinnings->fours }}" class="form-control" placeholder="চার">
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-12 text-center">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
#endsection
This is my BattersecondiningsController.php
public function edit(Battersecondinnings $battersecondinnings)
{
return view('battersecondinnings.edit',compact('battersecondinnings'));
}
/**
* Update the specified resource in storage.
*
* #param \Illuminate\Http\Request $request
* #param \App\Models\Battersecondinnings $battersecondinnings
* #return \Illuminate\Http\Response
*/
public function update(Request $request, Battersecondinnings $battersecondinnings)
{
$request->validate([
'name' => 'required',
'runs' => 'required',
'balls' => 'required',
'sixs' => 'required',
'fours' => 'required',
]);
$battersecondinnings->update($request->all());
return redirect()->route('battersecondinnings.index')
->with('success','Batter second innings updated successfully');
}
But same things is working in products/edit.blade.php
<form action="{{ route('products.update', $product->id) }}" method="POST" enctype="multipart/form-data">
#csrf
#method('PUT')
This is ProductController.php
public function edit(Product $product)
{
return view('products.edit',compact('product'));
}
public function update(Request $request, Product $product)
{
$request->validate([
'name' => 'required',
'runs' => 'required',
'balls' => 'required',
'sixs' => 'required',
'fours' => 'required',
]);
$product->update($request->all());
return redirect()->route('products.index')
->with('success','Product updated successfully');
}
This is web.php
Route::resource('battersecondinnings', BattersecondinningsController::class);

In the Route 'battersecondinnings.update' what is missing is enctype="multipart/form-data". Add it and try again.
Please ckeck this answer in stackoverflow multipart/form-data meaning

Related

why my validation doesen't work properly?

i'm working on a Laravel/Livewire project and my validation don't let my form to submit but errors are not shown in my blade .
i implemented my validation system same as Livewire documentation but it didn't work for me
even i tested some other ways like validator::make() but my bug didn't solved
my controller :
class Index extends Component
{
use WithPagination;
public $title, $en_title, $parent;
protected $rules = [
'title' => 'required',
'en_title' => 'required',
];
protected $paginationTheme = "bootstrap";
public function store()
{
$validate = $this->validate();
Category::create([
'title' => $this->title,
'en_title' => $this->en_title,
'parent_id' => $this->parent,
]);
$this->reset(['title', 'en_title', 'parent']);
session()->flash('add_category', 'دسته بندی با موفقیت اضافه شد');
}
}
my blade :
<form wire:submit.prevent="store" class="col-md-6">
<div>
<div class="form-group">
<label class="form-label">عنوان دسته بندی</label>
<input wire:model.defer="title" type="text" class="form-control" placeholder="نام دسته بندی">
#error('title') <div class="invalid-feedback">{{$message}}</div> #enderror
</div>
<div class="form-group">
<label class="form-label">title</label>
<input wire:model.defer="en_title" type="text" class="form-control" placeholder="عنوان انگلیسی دسته بندی">
#error('en_title') <div class="invalid-feedback">{{$message}}</div> #enderror
</div>
<div class="form-group">
<label class="form-label">دسته بندی والد</label>
<select wire:model.defer="parent" id="select-countries" class="form-control custom-select">
<option value="">بدون والد</option>
#foreach($categoriesCreate as $category)
<option value="{{$category->id}}">{{$category->title}}</option>
#if (count($category->childrenRecursive) > 0)
#include('layouts.partials', ['categories' => $category->childrenRecursive, 'level'=> 1, 'create' => 1])
#endif
#endforeach
</select>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-success mt-1 mb-1">افزودن</button>
<div wire:loading wire:target="store">
<div class="loader-wrapper d-flex justify-content-center align-items-center">
<div class="loader">
<div class="ball-pulse">
<div></div>
<div></div>
<div></div>
</div>
</div>
</div>
</div>
</div>
</form>
i don't know why but i removed invalid_feedback class from my #error() in my blade that related to bootstrap and my errors are shown

zoom integration MacsiDigital / laravel-zoom Call to a member function get() on null

i am using MacsiDigital/laravel-zoom package but the problem is Call to a member function get() on null i dont know why and i made everything correct
i am using MacsiDigital/laravel-zoom package but the problem is Call to a member function get() on null i dont know why and i made everything correct
here is my code
this is my create blade
<form method="post" action="{{ route('online_classes.store') }}" autocomplete="off">
#csrf
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="Grade_id">{{ trans('Students_trans.Grade') }} : <span
class="text-danger">*</span></label>
<select class="custom-select mr-sm-2" name="grade">
<option selected disabled>{{ trans('Parent_trans.Choose') }}...</option>
#foreach ($Grades as $Grade)
<option value="{{ $Grade->id }}">{{ $Grade->name }}</option>
#endforeach
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="Classroom_id">{{ trans('Students_trans.classrooms') }} : <span
class="text-danger">*</span></label>
<select class="custom-select mr-sm-2" name="class">
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label for="section_id">{{ trans('Students_trans.section') }} : </label>
<select class="custom-select mr-sm-2" name="section_id">
</select>
</div>
</div>
</div><br>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label>عنوان الحصة : <span class="text-danger">*</span></label>
<input class="form-control" name="topic" type="text">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>تاريخ ووقت الحصة : <span class="text-danger">*</span></label>
<input class="form-control" type="datetime-local" name="start_time">
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label>مدة الحصة بالدقائق : <span class="text-danger">*</span></label>
<input class="form-control" name="duration" type="text">
</div>
</div>
</div>
<button class="btn btn-success btn-sm nextBtn btn-lg pull-right"
type="submit">{{ trans('Students_trans.submit') }}</button>
</form>
and this is my fillable model
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class online_class extends Model
{
protected $fillable = [
'grade_id',
'classroom_id',
'section_id',
'topic',
'start_at',
'duration',
'user_id',
'meeting_id',
'start_url',
'join_url',
'password',
];
public function user(){
return $this->belongsTo(User::class,'user_id');
}
}
and this is my store method in controller
public function store(Request $request)
{
$user = Zoom::user()->first();
$meeting = Zoom::meeting()->make([
'topic' => $request->topic,
'duration' => $request->duration,
'password' => $request->password,
'start_time' => $request->start_time,
'timezone' => 'Africa/Cairo',
]);
$meeting->settings()->make([
'join_before_host' => false,
'approval_type' => 1,
'registration_type' => 2,
'enforce_login' => false,
'waiting_room' => false,
]);
online_class::create([
'grade_id' => $request->grade,
'classroom_id' => $request->class,
'section_id' => $request->section_id,
'topic' => $request->topic,
'start_at' => $request->start_time,
'duration' => $meeting->duration,
'user_id' => Auth::user()->id,
'meeting_id' => $meeting->id,
'start_url' => $meeting->start_url,
'join_url' => $meeting->join_url,
'password' => $meeting->password,
]);
return $user->meetings()->save($meeting);
}

Laravel Authintication not validate all fields

My laravel project not validate all fileds of my register form
Url: http://themovingpixel.com/myfinancialgoals/register
My resources/views/auth/register.blade.php code is here
#extends('layouts.register')
#section('content')
<div class="stage_top_bg">Financial Advisors Register</div>
<div class="container">
<div class="financial_mid_box">
<form name="myform" action="{{ url('/register') }}" method="POST">
{{ csrf_field() }}
<div class="stage_box">
<div class="stage_one_box stage_active steps">Stage 1</div>
<div class="stage_two_box steps">Stage 2</div>
<div class="stage_three_box steps">Stage 3</div>
<div class="stage_four_box steps">Stage 4</div>
</div>
<div class="financial_form_box formone">
<div class="col-lg-6 col-md-6">
<div class="financial_fild_main_box"> <span class="name_text">Name</span>
<div class="name_fild">
<input name="name" class="name_main_fild" type="text" placeholder="Name">
</div>
#if ($errors->has('name'))
<span class="help-block"><strong>{{ $errors->first('name') }}</strong></span>
#endif
</div>
</div>
<div class="col-lg-6 col-md-6">
<div class="financial_fild_main_box"> <span class="name_text">Practice</span>
<div class="name_fild">
<input name="practice" class="name_main_fild" type="text" placeholder="Practice">
</div>
#if ($errors->has('practice'))
<span class="help-block"><strong>{{ $errors->first('practice') }}</strong></span>
#endif
</div>
</div>
<div class="col-lg-6 col-md-6">
<div class="financial_fild_main_box"> <span class="name_text">Phone</span>
<div class="name_fild">
<input name="phone_number" class="name_main_fild" type="tel" placeholder="Phone">
</div>
#if ($errors->has('phone_number'))
<span class="help-block"><strong>{{ $errors->first('phone_number') }}</strong></span>
#endif
</div>
</div>
<div class="col-lg-6 col-md-6">
<div class="financial_fild_main_box"> <span class="name_text">Email</span>
<div class="name_fild">
<input name="email" class="name_main_fild" type="text" placeholder="Email">
</div>
#if ($errors->has('email'))
<span class="help-block"><strong>{{ $errors->first('email') }}</strong></span>
#endif
</div>
</div>
<div class="col-lg-6 col-md-6">
<div class="financial_fild_main_box"> <span class="name_text">Password</span>
<div class="name_fild">
<input name="password" class="name_main_fild" type="password" placeholder="Password">
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="procced_button">Proceed</div>
</div>
<div class="financial_form_box stepsone">
<div class="col-lg-6 col-md-6">
<div class="financial_fild_main_box"> <span class="name_text">Package</span>
<div class="name_fild">
<select name="packages" class="name_main_fild">
<option value="0">Select</option>
<option value="45">$45/month</option>
<option value="60">$60/month</option>
</select>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="procced_button btns">Proceed</div>
</div>
<div class="financial_form_box steptwo">
<div class="financial_fild_main_box"> <span class="name_text">Payment</span>
<div class="payament_box"> <!-- <a href="#">
<div class="payament_icon"><img src="{{ asset('assets/frontend/images/payaple_icon.jpg')}}" alt="icon"></div>
</a> <a href="#">
<div class="payament_icon"><img src="{{ asset('assets/frontend/images/ebay_icon.jpg')}}" alt="icon"></div>
</a> <a href="#">
<div class="payament_icon"><img src="{{ asset('assets/frontend/images/pay_icon_three.jpg')}}" alt="icon"></div>
</a> <a href="#">
<div class="payament_icon"><img src="{{ asset('assets/frontend/images/pay_icon_four.jpg')}}" alt="icon"></div>
</a> <a href="#">
<div class="payament_icon"><img src="{{ asset('assets/frontend/images/pay_icon_six.jpg')}}" alt="icon"></div>
</a> <a href="#">
<div class="payament_icon"><img src="{{ asset('assets/frontend/images/pay_icon_seven.jpg')}}" alt="icon"></div>
</a> <a href="#">
<div class="payament_icon"><img src="{{ asset('assets/frontend/images/pay_icon_eight.jpg')}}" alt="icon"></div>
</a> -->
<div class="name_fild">
<select name="payment_type" class="name_main_fild">
<option value="0">Select</option>
<option value="paypal">Paypal</option>
<option value="ebay">Ebay</option>
<option value="cirrus">Cirrus</option>
<option value="visa">Visa</option>
<option value="discover">Discover</option>
<option value="google">Google</option>
<option value="eway">Eway</option>
</select>
</div>
</div>
</div>
<div class="clearfix"></div>
<div class="procced_button"><button type="submit" class="process_btn">Proceed</button></div>
</div>
</form>
</div>
</div>
#endsection
And my app/Http/Controllers/Auth code is here
<?php
namespace App\Http\Controllers\Auth;
use App\User;
use App\Userinfo;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
class AuthController extends Controller
{
/*
|--------------------------------------------------------------------------
| Registration & Login Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users, as well as the
| authentication of existing users. By default, this controller uses
| a simple trait to add these behaviors. Why don't you explore it?
|
*/
use AuthenticatesAndRegistersUsers, ThrottlesLogins;
/**
* Where to redirect users after login / registration.
*
* #var string
*/
protected $redirectTo = '/profile';
/**
* Create a new authentication controller instance.
*
* #return void
*/
public function __construct()
{
$this->middleware($this->guestMiddleware(), ['except' => 'logout']);
}
/**
* Get a validator for an incoming registration request.
*
* #param array $data
* #return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'practice' => 'required',
'password' => 'required|min:6|confirmed',
]);
}
/**
* Create a new user instance after a valid registration.
*
* #param array $data
* #return User
*/
protected function create(array $data)
{
//Validation
$this->validate($data, [
'name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'practice' => 'required|max:255',
'phone_number' => 'required|number',
'password' => 'required|min:6|confirmed',
]);
$insertedUserInfo = User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
// echo '<pre>'.print_r($userinfo,1).'</pre>';
// exit;
// $userinfo = new Userinfo;
// $userinfo->user_id = $insertedUserInfo->id;
// $userinfo->phone_number = $data['phone_number'];
// $userinfo->address = $data['address'];
// return $userinfo->save();
Userinfo::create([
'user_id' => $insertedUserInfo->id,
'phone_number' => $data['phone_number'],
'practice' => $data['practice'],
'dob' => $data['dob'],
'postcode' => $data['postcode'],
'gender' => $data['gender']
]);
return $insertedUserInfo;
}
}
Please help me to validate registration from this from data goes to 3tables users,userinfo tables.
First of all for this type of steps layout you should have some client side validation too.
For that you can use jquery validate.
Take a look at this
your validator will only validate fields inside array
$this->validate($data, [
'name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'practice' => 'required|max:255',
'phone_number' => 'required|number',
'password' => 'required|min:6|confirmed',
]);
So you have to pass field names to your validation array to validate that field.
Validate method expect 1st param as Request instance, but not array($data) as you made.
https://laravel.com/api/5.1/Illuminate/Foundation/Validation/ValidatesRequests.html#method_validate

laravel- brain jaming error Undefined property: Illuminate\Database\Eloquent\Collection::$id

UserController.php
public function edit_profile(){
$input = Input::all();
$res = array();
$_m = "";
$rules = array(
'userName' => 'required',
'fullName' => 'required',
'shopName' => 'required',
'userType' => 'required',
'email' => 'required',
'aboutMe' =>'required',
'address' =>'required',
'city' =>'required',
'country' =>'required',
'contactNo' =>'required|regex:/[0-9]{10,11}/',
);
$validator = Validator::make($input, $rules);
if (!$validator->fails())
{
$user = User::find(Auth::user()->get()->id);
$user->fullname = $input('fullName');
$user->username = $input('userName');
$user->businessname = $input('shopName');
$user->usertype = $input('userType');
$user->email = $input('email');
$user->aboutme = $input('aboutMe');
$user->address = $input('address');
$user->city = $input('city');
$user->country = $input('country');
$user->phone = $input('contactNo');
$user->save();
$res['success'] = true;
$res['message'] = "NO";
return Redirect::to('user.profile');
}
else
{
return Redirect::to('login');
}
}
profile.blade.php
<div class="tab-pane fade" id="p2">
<h2>Account details</h2>
<div class="hr hr-12 hr-double"></div>
{{ Form::open(array('url'=>'profile','class' =>'form-horizontal')) }}
<div class="form-group">
<label class="col-sm-3 control-label">Full Name:</label>
<div class="col-sm-3">
{{ Form::text('fullName',ucwords(Auth::user()->fullname),array('class'=>'form-control', 'placeholder'=> 'Full Name Here' )) }}
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">User Name:</label>
<div class="col-sm-3">
{{ Form::text('userName',ucwords(Auth::user()->username),array('class'=>'form-control', 'placeholder'=>'e.g ali.ali')) }}
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Shop Name:</label>
<div class="col-sm-5">
{{ Form::text('shopName',ucwords(Auth::user()->businessname),array('class'=>'form-control', 'placeholder'=>'e.g Niazi Traders')) }}
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Email</label>
<div class="col-sm-4">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-envelope"></i></span>
{{ Form::email('email',ucwords(Auth::user()->email),array('class'=>'form-control', 'placeholder'=>'e.g john.smith#example.com')) }}
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">User Type:</label>
<div class="col-sm-4">
<div class="input-group">
<span class="input-group-addon"></span>
{{ Form::select('userType',array('D'=>'Distributor', 'W'=>'Whole Saler','R' =>'Retailer'),ucwords(Auth::user()->usertype)) }}
</div>
</div>
</div>
<hr class="separator">
<div class="form-group">
<label class="col-sm-3 control-label">About Me:</label>
<div class="col-sm-9">
{{ Form::textarea('aboutMe',ucwords(Auth::user()->aboutme),array('class'=>'form-control','id'=>'about-editor','placeholder'=>'Some thing about yourself......')) }}
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Address:</label>
<div class="col-sm-7">
{{ Form::text('address',ucwords(Auth::user()->address),array('class'=>'form-control','placeholder'=>'')) }}
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">City:</label>
<div class="col-sm-3">
{{ Form::text('city',ucwords(Auth::user()->city),array('class'=>'form-control','placeholder'=>'e.g Islamabad')) }}
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Country:</label>
<div class="col-sm-4">
{{ Form::text('country',ucwords(Auth::user()->country),array('class'=>'form-control','placeholder'=>'e.g Pakistan')) }}
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Phone Number:</label>
<div class="col-sm-3">
{{ Form::text('contactNo',ucwords(Auth::user()->phone),array('class'=>'form-control','placeholder'=>'e.g 0300xxxxxx')) }}
</div>
</div>
<div class="form-actions">
<div class="form-group">
<div class="col-sm-offset-3 col-sm-9">
{{ Form::submit('Submit',array('class'=>'btn btn-primary')) }}
{{ Form::submit('Cancel',array('class'=>'btn btn-inverse')) }}
</div>
</div>
</div>
{{ Form::close() }}
</div>
Routes.php
Route::get('logout','UserController#get_logout');
Route::get('profile', 'UserController#get_profile');
Route::post('profile', 'UserController#edit_profile');
User.php
class User extends Eloquent implements UserInterface, RemindableInterface {
use UserTrait, RemindableTrait;
/**
* The database table used by the model.
*
* #var string
*/
protected $table = 'users';
/**
* The attributes excluded from the model's JSON form.
*
* #var array
*/
protected $hidden = array('password', 'remember_token');
}
Error lies in this line
$user = User::find(Auth::user()->get()->id);
get is a function of Builder class used for getting a collection of record, Auth::user() returns a single user so you just need to access its id property
change above line to
$user = User::find(Auth::user()->id);
but Auth::user you give the current user so you dont need to find it again, you can access its property directly
$user = Auth::user();

I got unauthorized page after submit change password form and call logout function in laravel 5

I have overridden postReset method in PassowrdController:
public function postReset(Request $request)
{
$data = Input::all();
$rules = array(
'token' => 'required',
'current_password' => 'required|currentpasscheck',
'password' => 'required|confirmed',
);
$messages = array(
'currentpasscheck' => 'Your old password was incorrect',
);
Validator::extend('currentpasscheck', function ($attribute, $value, $parameters)
{
return Hash::check($value, Auth::user()->getAuthPassword());
});
$validation = Validator::make($data, $rules, $messages);
if ($validation->fails())
{
// Validation has failed.
return Redirect::to('password-reset')
->withErrors($validation)
->withInput();
}
$user = Auth::user();
$user->password = bcrypt($data['password']);
$user->save();
$this->auth->logout();
return Redirect::to('/');
}
route:
Route::post('/password/reset', 'Auth\PasswordController#postReset');//this can be accessed by auth user
reset.blade.php
#extends('app')
#section('content')
<div class="container-fluid">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Reset Password</div>
<div class="panel-body">
#if (count($errors) > 0)
<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
<form class="form-horizontal" role="form" method="POST" action="{{ url('/password/reset') }}">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="hidden" name="token" value="{{ $token }}">
<div class="form-group">
<!-- <label class="col-md-4 control-label">E-Mail Address</label>-->
<label class="col-md-4 control-label">Current Password</label>
<div class="col-md-6">
<input type="password" class="form-control" name="current_password" value="{{ old('current_password') }}">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Password</label>
<div class="col-md-6">
<input type="password" class="form-control" name="password">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label">Confirm Password</label>
<div class="col-md-6">
<input type="password" class="form-control" name="password_confirmation">
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<button type="submit" class="btn btn-primary">
Reset Password
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
#endsection
but after submit change password form I got unauthorized page.

Resources