DISABLE LARAVEL AUTO-LOGIN AFTER REGISTRATION
After registration, it will show a message on the same page with ‘Registered successfully, please login…!”
For this, Add some code snippet in RegisterController.php
public function register(Request $request) { $this->validator($request->all())->validate(); event(new Registered($user = $this->create($request->all()))); return back()->withAlert('Registered successfully, please login...!'); }
Add some code in register.blade.php between panel-body and form tags to setup display for the message.
Nb: remember to use correct html tags for div, as they are purposefully removed to display code.
div class=”panel-body”
@if(Session::has(‘alert’))
div class=”alert alert-success”
{{ Session::get(‘alert’) }}
@php
Session::forget(‘alert’);
@endphp
/div
@endif
<form class=”form-horizontal” method=”POST” action=”{{ route(‘register’) }}”>
@if(Session::has(‘alert’))
div class=”alert alert-success”
{{ Session::get(‘alert’) }}
@php
Session::forget(‘alert’);
@endphp
/div
@endif
<form class=”form-horizontal” method=”POST” action=”{{ route(‘register’) }}”>
Now click the register link from the navigational bar and try registering. You will be notified with the “Registration successful” message as one shown in the above picture.
Post a Comment