Skip to content

Commit

Permalink
revision trait fix getSystemUserId
Browse files Browse the repository at this point in the history
  • Loading branch information
veneliniliev committed Dec 12, 2016
1 parent b7686b6 commit 9885e6e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion app/Traits/RevisionableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,20 @@ private function isRevisionable($key)
**/
public function getSystemUserId()
{

if (\ProVision\Administration\Administration::routeInAdministration()) {
$this->guard = 'provision_administration';
} else {
$this->guard = 'web';
}

return \Auth::guard($this->guard)->user()->id;

if (\Auth::guard($this->guard)->check()) {
return \Auth::guard($this->guard)->user()->id;
}

return null;

//
// try {
// if (class_exists($class = '\SleepingOwl\AdminAuth\Facades\AdminAuth')
Expand Down
4 changes: 2 additions & 2 deletions resources/views/empty-form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
@foreach($revData->sortBy('created_at')->reverse() as $history)
<li>
@if($history->key == 'created_at' && !$history->old_value)
<b>{{ $history->userResponsible()->name }}</b> created this resource
<b>{{ @$history->userResponsible()->name }}</b> created this resource
at {{ $history->newValue() }}
@else
<b>{{ $history->userResponsible()->name }}</b> changed
<b>{{ @$history->userResponsible()->name }}</b> changed
<b>{{trans($form->getModel()->module.'::admin.'.$history->fieldName()) }}</b>
from <b>{{ $history->oldValue() }}</b> to <b>{{ $history->newValue() }}</b>
@endif
Expand Down

0 comments on commit 9885e6e

Please sign in to comment.