πŸ’‘ 두 κ°€μ§€ 덜 μ•Œλ €μ§„ Laravel 트릭: numerify & invisible

λ°œν–‰: (2025λ…„ 12μ›” 12일 μ˜€μ „ 07:18 GMT+9)
1 min read
원문: Dev.to

Source: Dev.to

Eloquent νŒ©ν† λ¦¬μ—μ„œ numerify

Faker의 numerify λ©”μ„œλ“œλŠ” # 문자λ₯Ό λ¬΄μž‘μœ„ 숫자둜 ꡐ체해 μ€λ‹ˆλ‹€.

public function definition(): array
{
    return [
        'phone' => $this->faker->numerify('+##'), // Example output: +20
    ];
}

λ§ˆμ΄κ·Έλ ˆμ΄μ…˜μ—μ„œ invisible

invisible 컬럼 μˆ˜μ •μžλŠ” μ»¬λŸΌμ„ λ°μ΄ν„°λ² μ΄μŠ€μ—λŠ” 남겨 λ‘λ©΄μ„œ κΈ°λ³Έ SELECT μΏΌλ¦¬μ—μ„œλŠ” μˆ¨κΉλ‹ˆλ‹€.

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;

Schema::create('users', function (Blueprint $table) {
    $table->timestamp('email_verified_at')
          ->nullable()
          ->invisible();
});

더 λ§Žμ€ νŒμ„ 찾아보고 μ—¬κΈ°μ„œ 지식을 κ³΅μœ ν•˜μ„Έμš”:
https://github.com/digging-code-blog

Back to Blog

κ΄€λ ¨ κΈ€

더 보기 Β»

Laravel, Symfony, Doppar 2026λ…„ β€” μ–΄λ–€ PHP ν”„λ ˆμž„μ›Œν¬λ₯Ό 선택해야 ν• κΉŒμš”?

κ°€κΉŒμš΄ λ―Έλž˜μ— μ˜€μ‹  것을 ν™˜μ˜ν•©λ‹ˆλ‹€. 이제 2026년이 λ‹€κ°€μ˜€κ³  μžˆμŠ΅λ‹ˆλ‹€. 이 글을 읽고 μžˆλ‹€λ©΄, λ§Žμ€ 외뢀인듀이 λΆ€μΈν•˜λŠ” 진싀을 이미 μ•Œκ³  계싀 κ²λ‹ˆλ‹€: PHPλŠ” μ£½μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€. 사싀, 그것은 λΉ λ₯΄κ²Œβ€¦

πŸš€ λ‚˜λ§Œμ˜ 개발자 μ›Œν¬ν”Œλ‘œμš° λ§Œλ“€κΈ°: VSCode, Vim, 그리고 Zsh

β€œμ§€νœ˜μžμ²˜λŸΌ 손을 νœ˜λ‘λ₯΄λ©΄ λͺ¨λ“  μ•…κΈ°κ°€ μ •ν™•νžˆ μ›ν•˜λŠ” λŒ€λ‘œ μ—°μ£Όλ˜λŠ” λͺ¨μŠ΅μ„ 상상해 λ³΄μ„Έμš”. λ°”λ‘œ κ·Έ λŠλ‚Œμ„ 맀일 제 μ›Œν¬ν”Œλ‘œμš°μ—μ„œ μΆ”κ΅¬ν•©λ‹ˆλ‹€.” As a de...