I want to display user's image in menu bar that is part of master page. master.blade.php
<div class="login_area">
@if (Auth::check())
<img src="{{asset('public/user_images/1531068734.jpg')}}" height="40px"
width="40px" alt="" class="pull-left img-circle login">
<a href="{{ route('logout') }}" onclick="event.preventDefault();
document.getElementById('logout-form').submit();"><i class="fa fa-sign-in" aria-hidden="true"></i> Logout</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
</form>
@else
<a href="http://www.abc.in\login">Login</a><a href="http://abc.in/register">Registration</a>
@endif
</div>
Image model : Each image is associated with each profile. and each profile is associated with user.
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
class image extends Model
{
protected $fillable =
['profile_id','user_id','image_name','image_status','image_permission'];
protected $primaryKey = 'image_id';
public function profile()
{
return $this->belongsTo(profile::class,'id','id');
}
}