- resources/views/article/show.blade.php
@if(Auth::guest())
<comment title="评论"
commentable-type="articles"
commentable-id="{{ $article->id }}"></comment>
@else
<comment title="评论"
username="{{ Auth::user()->name }}"
user-avatar="{{ Auth::user()->avatar }}"
commentable-type="articles"
commentable-id="{{ $article->id }}"
can-comment></comment>
@endif
<comment></comment> 该标签是如何处理的哩?
resources/assets/js/home.js
Vue.component('comment', require('components/Comment.vue'))
User 模型
use Illuminate\Notifications\Notifiable;
trait Notifiable
{
use HasDatabaseNotifications, RoutesNotifications;
}