Online Exam Quiz

questionQuestion  1 to 30

What is the default database engine used by Laravel?

  • MySQL
  • SQLite
  • PostgreSQL
  • MongoDB
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 Laravel Valet?

  • To manage application deployment
  • To handle asset compilation
  • To provide local development environment
  • To manage database migrations
Mark for review

What is the purpose of the composer update command in Laravel?

  • Updates all dependencies to their latest versions
  • Installs Laravel globally
  • Updates only Laravel core files
  • Installs a new Laravel project
Mark for review

How can you define a named route in Laravel?

  • Route::get('route', 'Controller@method')->name('name');
  • Route::name('name')->get('route', 'Controller@method');
  • Route::get('route', 'Controller@method', ['as' => 'name']);
  • Route::get('route', ['name' => 'name', 'uses' => 'Controller@method']);
Mark for review

How can you access request data in Laravel controllers?

  • request()->input('key')
  • request('key')
  • Request::get('key')
  • input('key')
Mark for review

Which artisan command is used to create a new migration with a specific table name?

  • php artisan make:migration create_table_name
  • php artisan make:migration create_table_name_table
  • php artisan make:migration create_table_name_schema
  • php artisan make:migration table_name
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 NOT a valid Eloquent relationship type?

  • belongsTo
  • hasOne
  • hasManyThrough
  • fetchMany
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

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

What is the purpose of Laravel Telescope?

  • To manage database migrations
  • To handle asset compilation
  • To provide debugging and monitoring for Laravel applications
  • To manage application deployment
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

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

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

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

How can you include subviews in Laravel Blade templates?

  • Using @include('view.name') directive
  • Using @yield('section') directive
  • Using @extends('layout.name') directive
  • Using @section('content') directive
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

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

Which Laravel feature is used for unit testing?

  • PHPUnit
  • Laravel Tinker
  • Mockery
  • Laravel Dusk
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 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 define a new database connection in Laravel?

  • Modify config/database.php
  • Use .env file
  • Use php artisan make:connection command
  • Modify routes/web.php
Mark for review

Which Laravel feature provides a fluent interface to define database queries?

  • Eloquent ORM
  • Laravel Query Builder
  • Laravel Schema Builder
  • Laravel Facades
Mark for review

Which artisan command generates a key for the application?

  • php artisan app:key
  • php artisan generate:key
  • php artisan key:generate
  • php artisan make:key
Mark for review

What is the purpose of CSRF protection in Laravel?

  • To prevent cross-site scripting attacks
  • To prevent SQL injection attacks
  • To prevent cross-site request forgery attacks
  • To prevent session hijacking attacks
Mark for review

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

  • Creates a new database migration
  • Creates a new Eloquent model
  • Creates a new controller
  • Creates a new middleware
Mark for review

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

  • belongsTo
  • hasMany
  • hasOne
  • belongsToMany
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

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

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

Which of the following is a correct usage of logic

  • <logic
  • <logic
  • <logic
  • <logic
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