Skip to content

Commit

Permalink
Improve logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengjinghua committed Aug 9, 2016
1 parent e896d11 commit f185671
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions app/Models/Model.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
namespace App\Models;

use Watson\Rememberable\Rememberable;
use Illuminate\Database\Eloquent\Model as Eloquent;

abstract class Model extends Eloquent
{
use Rememberable;
}
4 changes: 2 additions & 2 deletions resources/views/topics/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
@endforeach
</div>

@include('topics.partials.topic_operate', ['manage_topics' => $currentUser->can("manage_topics")])
@include('topics.partials.topic_operate', ['manage_topics' => $currentUser ? $currentUser->can("manage_topics") : false])
</div>


Expand Down Expand Up @@ -104,7 +104,7 @@ class="vote btn btn-primary {{ $currentUser && $topic->votes()->ByWhom(Auth::id(
<div class="panel-body">

@if (count($replies))
@include('topics.partials.replies', ['manage_topics' => $currentUser->can("manage_topics")])
@include('topics.partials.replies', ['manage_topics' => $currentUser ? $currentUser->can("manage_topics") : false])
<div id="replies-empty-block" class="empty-block hide">{{ lang('No comments') }}~~</div>
@else
<ul class="list-group row"></ul>
Expand Down

0 comments on commit f185671

Please sign in to comment.