# Eloquent ORM 기초 (Laravel) > Models, CRUD 작업, query builder, mass assignment, timestamps, soft deletes, accessors, mutators - 22 면접 질문 - Junior - [면접 질문: Laravel](https://sharpskill.dev/ko/technologies/laravel/interview-questions.md) ## 1. Eloquent는 모델 이름에서 테이블 이름을 추론할 때 기본적으로 어떤 명명 규칙을 사용하나요? **답변** Eloquent는 클래스 이름의 복수형 snake_case를 사용하여 테이블 이름을 추론합니다. 예를 들어 User 모델은 users 테이블에 해당하고, BlogPost는 blog_posts에 해당합니다. 이 규칙은 모델에서 $table 속성을 정의하여 재정의할 수 있습니다. ## 2. 새 모델을 생성하고 저장하는 작업을 단일 작업으로 수행할 수 있는 Eloquent 메서드는 무엇인가요? **답변** create() 메서드는 속성 배열을 받아 모델 생성과 저장을 단일 작업으로 수행합니다. mass assignment로부터 보호하기 위해 속성이 $fillable 속성에 나열되어 있거나 $guarded가 정의되어 있어야 합니다. new Model() 후 save()를 호출하는 방식과 달리, create()는 이 두 단계를 결합합니다. ## 3. $fillable에 없는 속성을 mass assignment하려고 하면 어떻게 되나요? **답변** Laravel은 mass assignment 취약점으로부터 보호하기 위해 MassAssignmentException을 던집니다. 이 보호는 악의적인 사용자가 HTTP 요청을 통해 허가되지 않은 속성을 주입하는 것을 방지합니다. 속성을 $fillable에 추가하거나, $guarded를 사용해 특정 속성만 보호하거나, forceFill()을 사용해 보호를 우회해야 합니다. ## 19개 추가 질문 이용 가능 - Eloquent에서 find() 메서드와 findOrFail() 메서드의 차이는 무엇인가요? - Eloquent는 created_at과 updated_at 컬럼을 어떻게 자동으로 처리하나요? 무료로 가입하기: https://sharpskill.dev/ko/login ## 기타 Laravel 면접 주제 - [PHP 기초](https://sharpskill.dev/ko/technologies/laravel/interview-questions/php-basics.md): 25개 질문, Junior - [PHP 객체지향 기초](https://sharpskill.dev/ko/technologies/laravel/interview-questions/php-oop-essentials.md): 20개 질문, Junior - [Composer & Autoloading](https://sharpskill.dev/ko/technologies/laravel/interview-questions/composer-autoloading.md): 18개 질문, Junior - [Laravel 기초](https://sharpskill.dev/ko/technologies/laravel/interview-questions/laravel-fundamentals.md): 20개 질문, Junior - [Laravel 라우팅](https://sharpskill.dev/ko/technologies/laravel/interview-questions/laravel-routing.md): 20개 질문, Junior - [Blade Templates](https://sharpskill.dev/ko/technologies/laravel/interview-questions/blade-templates.md): 18개 질문, Junior - [Request & Response](https://sharpskill.dev/ko/technologies/laravel/interview-questions/request-response.md): 20개 질문, Junior - [Eloquent Relationships](https://sharpskill.dev/ko/technologies/laravel/interview-questions/eloquent-relationships.md): 25개 질문, Mid-Level - [Migrations & Schema Builder](https://sharpskill.dev/ko/technologies/laravel/interview-questions/database-migrations.md): 20개 질문, Mid-Level - [유효성 검사와 폼](https://sharpskill.dev/ko/technologies/laravel/interview-questions/validation-forms.md): 22개 질문, Mid-Level - [인증](https://sharpskill.dev/ko/technologies/laravel/interview-questions/authentication.md): 20개 질문, Mid-Level - [인가와 Policies](https://sharpskill.dev/ko/technologies/laravel/interview-questions/authorization-policies.md): 18개 질문, Mid-Level - [API Resources & Authentication](https://sharpskill.dev/ko/technologies/laravel/interview-questions/api-resources-authentication.md): 26개 질문, Mid-Level - [미들웨어](https://sharpskill.dev/ko/technologies/laravel/interview-questions/middleware.md): 18개 질문, Mid-Level - [Service Container & DI](https://sharpskill.dev/ko/technologies/laravel/interview-questions/service-container-di.md): 20개 질문, Mid-Level - [Queues & Jobs](https://sharpskill.dev/ko/technologies/laravel/interview-questions/queues-jobs.md): 22개 질문, Mid-Level - [Events & Listeners](https://sharpskill.dev/ko/technologies/laravel/interview-questions/events-listeners.md): 18개 질문, Mid-Level - [알림 및 메일](https://sharpskill.dev/ko/technologies/laravel/interview-questions/notifications-mail.md): 20개 질문, Mid-Level - [File Storage](https://sharpskill.dev/ko/technologies/laravel/interview-questions/file-storage.md): 18개 질문, Mid-Level - [Testing & PHPUnit](https://sharpskill.dev/ko/technologies/laravel/interview-questions/testing-phpunit.md): 24개 질문, Mid-Level - [Caching](https://sharpskill.dev/ko/technologies/laravel/interview-questions/caching.md): 18개 질문, Mid-Level - [Livewire & Inertia](https://sharpskill.dev/ko/technologies/laravel/interview-questions/livewire-inertia.md): 20개 질문, Mid-Level - [Eloquent Advanced](https://sharpskill.dev/ko/technologies/laravel/interview-questions/eloquent-advanced.md): 24개 질문, Senior - [Repository Pattern](https://sharpskill.dev/ko/technologies/laravel/interview-questions/repository-pattern.md): 20개 질문, Senior - [Laravel 패키지](https://sharpskill.dev/ko/technologies/laravel/interview-questions/laravel-packages.md): 20개 질문, Senior - [Performance Optimization](https://sharpskill.dev/ko/technologies/laravel/interview-questions/performance-optimization.md): 22개 질문, Senior - [Security Best Practices](https://sharpskill.dev/ko/technologies/laravel/interview-questions/security-best-practices.md): 22개 질문, Senior - [Laravel Octane](https://sharpskill.dev/ko/technologies/laravel/interview-questions/laravel-octane.md): 18개 질문, Senior - [Laravel Distributed Systems](https://sharpskill.dev/ko/technologies/laravel/interview-questions/laravel-distributed-systems.md): 22개 질문, Senior - [Observability & Monitoring](https://sharpskill.dev/ko/technologies/laravel/interview-questions/observability-monitoring.md): 20개 질문, Senior - [Deployment & DevOps](https://sharpskill.dev/ko/technologies/laravel/interview-questions/deployment-devops.md): 20개 질문, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ko/technologies/laravel/interview-questions/eloquent-orm-basics