Наследование: extends Illuminate\Database\Eloquent\Model
Пример #1
0
 /**
  * @param Polyglot $model
  *
  * @return array
  */
 protected function extractTranslatedAttributes(Polyglot &$model)
 {
     $attributes = $model->getAttributes();
     $polyglot = $model->getPolyglotAttributes();
     $translated = array();
     foreach ($attributes as $key => $value) {
         if (in_array($key, $polyglot)) {
             $translated[$key] = $value;
             unset($model[$key]);
         }
     }
     return $translated;
 }