今天小编就为大家分享一篇在Laravel 中实现是否关注的示例,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
废话不多说,直接上代码!
@if ($user->id !== Auth::user()->id) <div id="follow_form"> @if (Auth::user()->isFollowing($user->id)) id) }}" method="post"> {{ csrf_field() }} {{ method_field('DELETE') }} <button type="submit" class="btn btn-sm">取消关注</button> @else id) }}" method="post"> {{ csrf_field() }} <button type="submit" class="btn btn-sm btn-primary">关注</button><span style="color:transparent">来源gaodai#ma#com搞*!代#%^码网</span> @endif </div> @endif
通过显示不同的视图实现。
以上就是在Laravel 中实现是否关注的示例的详细内容,更多请关注gaodaima搞代码网其它相关文章!