Skip to content

Commit

Permalink
显示个人资料
Browse files Browse the repository at this point in the history
  • Loading branch information
summerblue committed Mar 6, 2022
1 parent 6f34ea2 commit 10e3009
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
16 changes: 1 addition & 15 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,18 @@ class User extends Authenticatable implements MustVerifyEmail
{
use HasApiTokens, HasFactory, Notifiable, MustVerifyEmailTrait;

/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'email',
'password',
'introduction',
];

/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'password',
'remember_token',
];

/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
Expand Down
14 changes: 7 additions & 7 deletions resources/views/users/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
<img class="card-img-top"
src="https://cdn.learnku.com/uploads/images/201709/20/1/PtDKbASVcz.png?imageView2/1/w/600/h/600"
alt="{{ $user->name }}">
<div class="card-body">
<h5><strong>个人简介</strong></h5>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>
<hr>
<h5><strong>注册于</strong></h5>
<p>January 01 1901</p>
</div>
<div class="card-body">
<h5><strong>个人简介</strong></h5>
<p>{{ $user->introduction }}</p>
<hr>
<h5><strong>注册于</strong></h5>
<p>{{ $user->created_at->diffForHumans() }}</p>
</div>
</div>
</div>
<div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
Expand Down

0 comments on commit 10e3009

Please sign in to comment.