/**
  * Get the value that should be assigned to the field.
  *
  * @param  string  $name
  * @param  string  $value
  * @return string
  */
 public function getValueAttribute($name, $value = null)
 {
     if (is_null($name)) {
         return $value;
     }
     if (isset($this->session) and $this->session->hasOldInput($name)) {
         return $this->session->getOldInput($name);
     }
     if (!is_null($value)) {
         return $value;
     }
     if (isset($this->model) and isset($this->model[$name])) {
         return $this->getModelValueAttribute($name);
     }
 }
Exemple #2
0
 /**
  * Determine if the session contains old input.
  *
  * @param string $key
  * @return bool 
  * @static 
  */
 public static function hasOldInput($key = null)
 {
     return \Illuminate\Session\Store::hasOldInput($key);
 }