Laravel MCQ
{
"questions": [
{
"question": "Who created the Laravel PHP framework?",
"options": ["Taylor Otwell", "Rasmus Lerdorf", "Fabien Potencier", "Brendan Eich"],
"answer": 0
},
{
"question": "Laravel follows which architectural pattern?",
"options": ["MVC", "MVVM", "MVP", "Layered"],
"answer": 0
},
{
"question": "Which command is used to create a new Laravel project via Composer?",
"options": ["composer create laravel", "composer new laravel", "composer create-project laravel/laravel", "laravel new project"],
"answer": 2
},
{
"question": "Which file contains environment configuration in Laravel?",
"options": [".config", ".env", "config.php", "settings.json"],
"answer": 1
},
{
"question": "Which ORM is used in Laravel?",
"options": ["Doctrine", "Eloquent", "Hibernate", "Sequelize"],
"answer": 1
},
{
"question": "Which Artisan command creates a controller?",
"options": ["php artisan make:controller", "php artisan new:controller", "php artisan create:controller", "php artisan controller:make"],
"answer": 0
},
{
"question": "Blade is Laravel's ______.",
"options": ["Database engine", "Template engine", "Routing system", "Queue manager"],
"answer": 1
},
{
"question": "Which file defines web routes in Laravel?",
"options": ["routes/api.php", "routes/web.php", "routes/console.php", "routes/channels.php"],
"answer": 1
},
{
"question": "Which command runs Laravel migrations?",
"options": ["php artisan migrate", "php artisan db:run", "php artisan migration", "php artisan db:migrate"],
"answer": 0
},
{
"question": "Which helper is used to generate URLs in Laravel?",
"options": ["route()", "url()", "path()", "link()"],
"answer": 1
},
{
"question": "Middleware in Laravel is primarily used for ______.",
"options": ["Database queries", "Filtering HTTP requests", "Rendering views", "Sending emails"],
"answer": 1
},
{
"question": "Which directory stores Laravel models by default?",
"options": ["app/Models", "resources/models", "database/models", "models/"],
"answer": 0
},
{
"question": "Which command clears Laravel cache?",
"options": ["php artisan clear", "php artisan cache:clear", "php artisan config:clear", "php artisan route:clear"],
"answer": 1
},
{
"question": "Laravel uses which package manager for PHP dependencies?",
"options": ["npm", "Composer", "Yarn", "Bower"],
"answer": 1
},
{
"question": "Which Blade directive is used for loops?",
"options": ["@loop", "@for", "@foreach", "@iterate"],
"answer": 2
},
{
"question": "Which command creates a migration file?",
"options": ["php artisan make:migration", "php artisan new:migration", "php artisan create:migration", "php artisan migration:new"],
"answer": 0
},
{
"question": "Which Laravel feature provides authentication scaffolding?",
"options": ["Laravel Auth", "Laravel Breeze", "Laravel Guard", "Laravel Secure"],
"answer": 1
},
{
"question": "Which directory contains Blade view files?",
"options": ["resources/views", "app/views", "views/", "storage/views"],
"answer": 0
},
{
"question": "Which method retrieves all records in Eloquent?",
"options": ["getAll()", "fetch()", "all()", "records()"],
"answer": 2
},
{
"question": "Which command starts Laravel development server?",
"options": ["php artisan serve", "php artisan run", "laravel serve", "php serve"],
"answer": 0
},
{
"question": "Which component handles background jobs in Laravel?",
"options": ["Scheduler", "Queue", "Worker", "Daemon"],
"answer": 1
},
{
"question": "Which function protects against CSRF attacks in forms?",
"options": ["@csrf", "@token", "@secure", "@protect"],
"answer": 0
},
{
"question": "Which file manages database configuration?",
"options": ["config/database.php", "database/config.php", "config/db.php", "db/config.php"],
"answer": 0
},
{
"question": "Which relationship defines one-to-many in Eloquent?",
"options": ["hasOne()", "hasMany()", "belongsTo()", "manyToOne()"],
"answer": 1
},
{
"question": "Laravel scheduler is defined in which file?",
"options": ["routes/console.php", "app/Console/Kernel.php", "config/schedule.php", "app/Scheduler.php"],
"answer": 1
},
{
"question": "Which command generates a model with migration?",
"options": ["php artisan make:model -m", "php artisan model:create -m", "php artisan make:model migration", "php artisan create:model -m"],
"answer": 0
},
{
"question": "Which helper returns authenticated user?",
"options": ["auth()->user()", "user()", "currentUser()", "sessionUser()"],
"answer": 0
},
{
"question": "Which Laravel feature manages events and listeners?",
"options": ["Dispatcher", "Event system", "Observer", "Trigger"],
"answer": 1
},
{
"question": "Which storage disk is default in Laravel?",
"options": ["local", "public", "s3", "ftp"],
"answer": 0
},
{
"question": "Which command publishes vendor assets?",
"options": ["php artisan vendor:publish", "php artisan publish", "php artisan asset:publish", "php artisan vendor:assets"],
"answer": 0
}
]
}
Comments
Post a Comment