π‘ λ κ°μ§ λ μλ €μ§ Laravel νΈλ¦: numerify & invisible
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