
Schema::getName() 메서드는 데이터베이스 스키마의 이름을 반환하는 메서드입니다.
이 메서드는 데이터베이스 스키마의 이름을 가져올 때 사용됩니다. 예를 들어, 특정 테이블의 스키마 이름을 가져올 때 사용할 수 있습니다.
Schema::getName() 메서드를 호출하는 방법은 다음과 같습니다.
#hostingforum.kr
php
$schema = new Schema();
$schemaName = $schema->getName();
이 메서드는 스키마의 이름을 문자열로 반환합니다.
이 메서드를 사용하는 예제 코드는 다음과 같습니다.
#hostingforum.kr
php
use IlluminateDatabaseSchemaBlueprint;
$schema = new Schema();
$schema->create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
});
$schemaName = $schema->getName();
echo $schemaName; // Output: users
이 예제 코드에서는 'users' 테이블의 스키마 이름을 가져오는 것을 보여줍니다.
2025-03-04 12:14