one way to check if user is loggen in or not
Next MEthod:
for seperate guard: also view another blog for more user pannel
@if(Auth::check())
<h1>{{Auth::user()->name}}</h1>
@else
<h1>name xaina</h1>
@endif
Next MEthod:
<div class="form-group ">
<span class="data-label" for="rider_email">Your Email</span>
@if(isset(Auth::user()->email))
<input class="form-control" type="email" name="rider_email" id="rider_email" readonly value="{{ Auth::user()->email }}">
@else
<input class="form-control" type="email" name="rider_email" id="rider_email" required>
@endif
@if ($errors->has('rider_email'))
<span class="help-block">
<strong>{{ $errors->first('rider_email') }}</strong>
</span>
@endif
</div>
for seperate guard: also view another blog for more user pannel
@if(isset(Auth::guard('admin')->user()->email))
<input type="text" class="form-control" id="email" name="email" placeholder="Email Address(optional)" readonly value="{{ Auth::guard('admin')->user()->email }}">
@else
<input type="text" class="form-control" id="email" name="email" value="{{old('email')}}" placeholder="Email Address(optional)">
@endif
Comments
Post a Comment