[ PHP Programming MCQS ]

झारखंड में आयोजित होने वाली JPSC, JSSC, JET, झारखंड पुलिस भर्ती परीक्षा आदि के लिए उपयोगी सामान्य अध्ययन।

[ PHP Programming MCQS ]

Useful GK for JPSC, JSSC, JET, Jharkhand Police and other exams.
451. Laravel Service Container क्या है?
[A] Dependency Injection Container
[B] Database Container
[C] Session Container
[D] Cache Container
451. What is Laravel Service Container?
[A] Dependency Injection Container
[B] Database Container
[C] Session Container
[D] Cache Container
सही उत्तर: Dependency Injection Container
व्याख्या: Classes और dependencies manage करता है।
Correct Answer: Dependency Injection Container
Explanation: Manages classes and dependencies.
452. Laravel Facades क्या प्रदान करते हैं?
[A] Static Interface
[B] Database Backup
[C] Session Security
[D] Queue Storage
452. What do Laravel Facades provide?
[A] Static Interface
[B] Database Backup
[C] Session Security
[D] Queue Storage
सही उत्तर: Static Interface
व्याख्या: Service Container की classes का static-like access।
Correct Answer: Static Interface
Explanation: Provides static-like access to services.
453. Laravel में eager loading किस समस्या को कम करता है?
[A] N+1 Query Problem
[B] Session Problem
[C] Cache Problem
[D] Route Problem
453. What problem does eager loading solve in Laravel?
[A] N+1 Query Problem
[B] Session Problem
[C] Cache Problem
[D] Route Problem
सही उत्तर: N+1 Query Problem
व्याख्या: Database queries की संख्या कम करता है।
Correct Answer: N+1 Query Problem
Explanation: Reduces database query count.
454. Laravel में lazy loading कब होती है?
[A] Relationship Access होने पर
[B] Application Start पर
[C] Migration Run पर
[D] Composer Install पर
454. When does lazy loading occur in Laravel?
[A] When Relationship is Accessed
[B] On Application Start
[C] During Migration
[D] During Composer Install
सही उत्तर: Relationship Access होने पर
व्याख्या: Data जरूरत पड़ने पर load होता है।
Correct Answer: When Relationship is Accessed
Explanation: Loads data only when needed.
455. Laravel में Soft Deletes के लिए कौन-सा trait उपयोग होता है?
[A] SoftDelete
[B] SoftDeletes
[C] DeleteTrait
[D] Trashable
455. Which trait enables Soft Deletes in Laravel?
[A] SoftDelete
[B] SoftDeletes
[C] DeleteTrait
[D] Trashable
सही उत्तर: SoftDeletes
व्याख्या: Deleted records database में बने रहते हैं।
Correct Answer: SoftDeletes
Explanation: Deleted records remain in database.
456. Laravel migration rollback command कौन-सा है?
[A] php artisan migrate:rollback
[B] php artisan rollback
[C] php artisan migrate:undo
[D] php artisan db:rollback
456. Which command rolls back migrations in Laravel?
[A] php artisan migrate:rollback
[B] php artisan rollback
[C] php artisan migrate:undo
[D] php artisan db:rollback
सही उत्तर: php artisan migrate:rollback
व्याख्या: Last migration batch revert करता है।
Correct Answer: php artisan migrate:rollback
Explanation: Reverts the last migration batch.
457. Laravel में API Resource का मुख्य उद्देश्य क्या है?
[A] Transform API Response
[B] Store Sessions
[C] Manage Routes
[D] Create Tables
457. What is the main purpose of Laravel API Resources?
[A] Transform API Response
[B] Store Sessions
[C] Manage Routes
[D] Create Tables
सही उत्तर: Transform API Response
व्याख्या: API output format को standardize करता है।
Correct Answer: Transform API Response
Explanation: Standardizes API response output.
458. Laravel Event का मुख्य उद्देश्य क्या है?
[A] Decouple Application Components
[B] Increase Queries
[C] Delete Records
[D] Compile Views
458. What is the main purpose of Laravel Events?
[A] Decouple Application Components
[B] Increase Queries
[C] Delete Records
[D] Compile Views
सही उत्तर: Decouple Application Components
व्याख्या: Loose coupling और event-driven architecture के लिए।
Correct Answer: Decouple Application Components
Explanation: Supports event-driven architecture.
459. Laravel Listener किसलिए उपयोग होता है?
[A] Handle Events
[B] Handle Routes
[C] Handle Views
[D] Handle CSS
459. What is a Laravel Listener used for?
[A] Handle Events
[B] Handle Routes
[C] Handle Views
[D] Handle CSS
सही उत्तर: Handle Events
व्याख्या: Triggered events पर action execute करता है।
Correct Answer: Handle Events
Explanation: Executes actions when events occur.
460. PHP 8 में Attributes का मुख्य उद्देश्य क्या है?
[A] Metadata जोड़ना
[B] Database बनाना
[C] Session Store करना
[D] File Upload करना
460. What is the main purpose of Attributes in PHP 8?
[A] Add Metadata
[B] Create Database
[C] Store Session
[D] Upload Files
सही उत्तर: Metadata जोड़ना
व्याख्या: Attributes code elements के साथ metadata attach करने की सुविधा देते हैं।
Correct Answer: Add Metadata
Explanation: Attributes allow attaching metadata to code elements.