示例#1
0
 public static function view($key)
 {
     $body = static::where('name', $key)->pluck('body');
     if ($body === null) {
         $row = new static();
         $row->name = $key;
         $row->title = '';
         $row->forceSave();
     }
     return $body;
 }
示例#2
0
 /**
  * Create a record without attempting to validate it
  *
  * @param  array $data
  * @return Vocal
  */
 public static function forceCreate(array $data = [])
 {
     $model = new static();
     $model->forceSave($data, true);
     return $model;
 }