# 미들웨어 (Laravel) > 미들웨어 생성, 글로벌 미들웨어, 라우트 미들웨어, 미들웨어 그룹, 미들웨어 매개변수, terminable 미들웨어 - 18 면접 질문 - Mid-Level - [면접 질문: Laravel](https://sharpskill.dev/ko/technologies/laravel/interview-questions.md) ## 1. Laravel에서 미들웨어란 무엇인가요? **답변** 미들웨어는 들어오는 요청과 나가는 응답을 검사하고 수정하는 HTTP 필터링 메커니즘입니다. 클라이언트의 요청과 애플리케이션의 응답 사이의 중간 계층 역할을 하며, controller가 요청을 처리하기 전이나 후에 코드를 실행할 수 있게 해줍니다. 미들웨어는 인증, CSRF 검증, 로깅, 헤더 수정 등에 사용됩니다. ## 2. Artisan을 사용하여 새 미들웨어를 만들려면 어떻게 하나요? **답변** php artisan make:middleware 명령은 app/Http/Middleware 디렉터리에 새 미들웨어를 생성합니다. 이 명령은 요청과 next 클로저를 받는 handle 메서드를 가진 클래스를 만듭니다. 그런 다음 미들웨어를 글로벌하게 등록하거나, 그룹에 등록하거나, bootstrap/app.php 파일을 통해 또는 routes에서 직접 특정 라우트에 할당할 수 있습니다. ## 3. HTTP 요청을 처리할 때 middleware의 어떤 메서드가 자동으로 호출되나요? **답변** handle 메서드는 route에 등록된 각 middleware에 대해 자동으로 호출됩니다. 이 메서드는 두 개의 파라미터를 받습니다. Request 객체와 스택에서 다음 middleware를 나타내는 next 클로저입니다. 처리를 계속하려면 request를 전달하여 next를 호출해야 합니다. 이 아키텍처를 통해 각 middleware가 처리 흐름을 검사, 수정 또는 중단할 수 있는 책임 연쇄를 구성할 수 있습니다. ## 15개 추가 질문 이용 가능 - 애플리케이션의 모든 HTTP 요청에 대해 middleware를 전역으로 등록하려면 어떻게 해야 하나요? - 특정 route에 middleware를 할당하려면 어떻게 해야 하나요? 무료로 가입하기: 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 ORM 기초](https://sharpskill.dev/ko/technologies/laravel/interview-questions/eloquent-orm-basics.md): 22개 질문, 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 - [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/middleware