firstOrCreate() 공개 정적인 메소드

Get the first record matching the attributes or create it.
public static firstOrCreate ( array $attributes ) : Model
$attributes array
리턴 Illuminate\Database\Eloquent\Model
예제 #1
0
 /**
  * Overrided firstOrCreate method of Model to trim data
  *
  * @return object
  */
 public static function firstOrCreate(array $data = array())
 {
     $trimedData = self::trimData($data);
     return parent::firstOrCreate($trimedData);
 }