Exemplo n.º 1
0
 /**
  * Determine if the given attribute may be mass assigned.
  *
  * @param  string  $key
  * @return bool
  */
 public function isFillable($key)
 {
     // File name is always treated as a fillable attribute.
     if ($key === 'fileName') {
         return true;
     }
     // If the key is in the "fillable" array, we can of course assume that it's
     // a fillable attribute. Otherwise, we will check the guarded array when
     // we need to determine if the attribute is black-listed on the model.
     if (in_array($key, $this->fillable)) {
         return true;
     }
     return empty($this->fillable) && !Str::startsWith($key, '_');
 }
Exemplo n.º 2
0
 /**
  * Determine if a given string starts with a given substring.
  *
  * @param string $haystack
  * @param string|array $needles
  * @return bool 
  * @static 
  */
 public static function startsWith($haystack, $needles)
 {
     //Method inherited from \Illuminate\Support\Str
     return \October\Rain\Support\Str::startsWith($haystack, $needles);
 }