Online Exam Quiz

questionQuestion  1 to 30

What is the purpose of Laravel Homestead?

  • To manage database migrations
  • To handle asset compilation
  • To provide a pre-packaged Vagrant box
  • To manage application deployment
Mark for review

How do you forward a request to another action in Struts?

  • Using ActionForward
  • Using RequestDispatcher
  • Using ActionMapping
  • Using HttpServletRequest
Mark for review

Which of the following is NOT a valid session driver in Laravel?

  • file
  • database
  • array
  • redis
Mark for review

What is the purpose of the php artisan migrate command in Laravel?

  • Creates database tables
  • Runs database migrations
  • Rolls back database migrations
  • Seeds the database
Mark for review

Which command can be used to run Laravel scheduler manually?

  • php artisan schedule:run
  • php artisan scheduler:run
  • php artisan run:scheduler
  • php run scheduler
Mark for review

Which of the following is NOT a valid method to define validation rules in Laravel?

  • Validator::make()
  • validate()
  • withValidator()
  • validateWith()
Mark for review

How can you access session data in Laravel?

  • Session::get('key');
  • Session::fetch('key');
  • Session::retrieve('key');
  • Session::find('key');
Mark for review

What does Eloquent refer to in Laravel?

  • A templating engine
  • An ORM (Object-Relational Mapping)
  • A testing framework
  • A package manager
Mark for review

Which method is used to delete a record using Eloquent in Laravel?

  • delete()
  • remove()
  • destroy()
  • erase()
Mark for review

How can you define a route that responds to both GET and POST requests in Laravel?

  • Route::get('/route', 'Controller@method');
  • Route::post('/route', 'Controller@method');
  • Route::any('/route', 'Controller@method');
  • Route::match(['get', 'post'], '/route', 'Controller@method');
Mark for review

What is the purpose of the php artisan cache:clear command in Laravel?

  • Clears the application cache
  • Clears the route cache
  • Clears the view cache
  • Clears the config cache
Mark for review

Which artisan command is used to create a new controller in Laravel?

  • php artisan make:controller
  • php artisan create:controller
  • php artisan controller:new
  • php artisan controller:create
Mark for review

How can you define a global variable in Laravel Blade templates?

  • Use @global directive
  • Use @set directive
  • Use @inject directive
  • Use @php directive
Mark for review

Which method is used to define a one-to-one relationship in Eloquent models in Laravel?

  • hasOne()
  • belongsTo()
  • hasOneThrough()
  • oneToOne()
Mark for review

How can you generate a new Laravel project?

  • composer create-project --prefer-dist laravel/laravel project-name
  • laravel new project-name
  • php artisan new project-name
  • composer new-project laravel/laravel project-name
Mark for review

How can you define a middleware in Laravel?

  • Define it in config/middleware.php
  • Register it in app/Providers/AppServiceProvider.php
  • Define it in app/Http/Middleware
  • Use php artisan make:middleware command
Mark for review

Which of the following is NOT a valid route group attribute in Laravel?

  • prefix
  • namespace
  • secure
  • name
Mark for review

Which of the following relationships in Eloquent represents a many-to-many relationship?

  • belongsTo
  • hasMany
  • hasOne
  • belongsToMany
Mark for review

What is the purpose of Laravel Passport?

  • To manage database migrations
  • To handle asset compilation
  • To provide OAuth2 authentication
  • To manage application deployment
Mark for review

Which directory contains the views in a Laravel application by default?

  • app
  • resources/views
  • public
  • views
Mark for review

Which of the following is a correct statement in struts-config.xml?

  • <message-resources parameter="com.example.resources.ApplicationResources" />
  • <messageResources parameter="com.example.resources.ApplicationResources" />
  • <resource-bundle parameter="com.example.resources.ApplicationResources" />
  • <resources parameter="com.example.resources.ApplicationResources" />
Mark for review

How can you define custom error messages for validation in Laravel?

  • Use the messages() method in the validator
  • Modify config/validation.php
  • Use errorMessages() function
  • Use withErrors() method
Mark for review

How can you generate URLs for named routes in Laravel Blade templates?

  • route('name')
  • url('name')
  • link('name')
  • path('name')
Mark for review

Which of the following is NOT a valid Blade directive in Laravel?

  • @yield
  • @section
  • @foreach
  • @ifelse
Mark for review

tag in Struts?

  • name="list" property="items">
  • list="items" name="list">
  • name="list" items="property">
  • property="list" items="items">
Mark for review

What is the purpose of the php artisan route:list command in Laravel?

  • Lists all registered routes
  • Clears route cache
  • Lists all route middleware
  • Lists all route parameters
Mark for review

How can you create a new migration that modifies an existing table in Laravel?

  • Use php artisan make:migration modify_table_name
  • Use php artisan make:migration alter_table_name
  • Use php artisan make:migration change_table_name
  • Use php artisan make:migration update_table_name
Mark for review

Which of the following is NOT a valid route parameter type in Laravel?

  • int
  • string
  • bool
  • float
Mark for review

What is the purpose of the php artisan make:middleware command in Laravel?

  • Creates a new middleware class
  • Registers middleware in the kernel
  • Applies middleware to routes
  • Deletes existing middleware
Mark for review

Which of the following is NOT a valid Eloquent relationship type?

  • belongsTo
  • hasOne
  • hasManyThrough
  • fetchMany
Mark for review

blinkerOnline

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • Answered
  • Not Answered
  • Marked for Review