예제 #1
0
 /**
  * @param \Illuminate\Database\Eloquent\Model|int|string $modelOrId
  *
  * @throws \Spatie\Activitylog\Exceptions\CouldNotLogActivity
  *
  * @return \Illuminate\Database\Eloquent\Model
  */
 protected function normalizeCauser($modelOrId) : Model
 {
     if ($modelOrId instanceof Model) {
         return $modelOrId;
     }
     if ($model = $this->auth->getProvider()->retrieveById($modelOrId)) {
         return $model;
     }
     throw CouldNotLogActivity::couldNotDetermineUser($modelOrId);
 }