Inheritance: extends Illuminate\Support\Facades\Facade
コード例 #1
0
ファイル: Artist.php プロジェクト: dbas-11/koel
 /**
  * Get an Artist object from their name.
  * If such is not found, a new artist will be created.
  *
  * @param string $name
  *
  * @return Artist
  */
 public static function get($name)
 {
     // Remove the BOM from UTF-8/16/32, as it will mess up the database constraints.
     if ($encoding = Util::detectUTFEncoding($name)) {
         $name = mb_convert_encoding($name, 'UTF-8', $encoding);
     }
     $name = trim($name) ?: self::UNKNOWN_NAME;
     return self::firstOrCreate(compact('name'), compact('name'));
 }