我想在作为母版页一部分的菜单栏中显示用户的图像。大师之刃.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>
图像模型:每个图像都与每个配置文件相关联。每个配置文件都与用户相关联。
<?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');
}
}