MCQs | Laravel/Laravel MCQ (Multiple Choice Question) Set 1 Sample Test,Sample questions

Question:
Artisan command to flush the application cache:

1. cache:flush

2.cache:clear

3.cache:forget

4.cache:remove


Question:
For what do the .env is used?

1.For setting environment variables

2.For running cron jobs

3. For tracking vendors

4.None of these


Question:
In which file we can set database connections?

1.database.php file

2.config.php file

3..env file

4.None of these


Question:
Interpolation of variable in laravel done using

1.compact

2. {{}}

3.helpers

4.None of these


Question:
What are the ways to get the data from database in laravel?

1.Query Builder

2.Eloquent ORM

3.both a and b

4.None of These


Question:
What is the minimum PHP version required to install Laravel 5.3?

1.7.1

2.5.6.4

3. 5.3.2

4.5.4.3


Question:
Where do we need to set database connection in Laravel?

1.config.php

2.setting.php

3.In seed files

4..ENV file


Question:
which command is used to clear the cache in laravel?

1.php artisan cache:clear

2.php artisan cache:clearall

3. php artisan clear:cache

4.None of These


Question:
Which directory contain “robot.txt” file ?

1.app

2.public

3.config

4.storage


Question:
__() in laravel used for

1.Printing value

2. For string translation

3.both (a) and (b)

4.None of these


Question:
Bootstrap directory in Laravel is used to

1. Initialize a Laraval application

2.Call laravel library functions

3.Load the configuration files

4.Load laravel classes and models


Question:
By default laravel project runs on which PORT?

1.3000

2.5000

3.8000

4.7000


Question:
Can laravel application support caching?

1.Yes

2.No

3.Can't Say

4. None of these


Question:
CLI Command to create controller in laravel?

1.php artisan make:controller Mycontroller

2.php artisan create:controller Mycontroller

3.php artisan controller Mycontroller

4.None of these


Question:
CLI Command to migrate in Laravel project?

1.php artisan create migration

2.php artisan migrate

3.php artisan serve

4.None of these


Question:
Command to check the current version of the Laravel Framwork?

1.php artisan main --version

2.php artisan --version status

3.php artisan check --version

4.php artisan --version


Question:
Command to check the current version of the Laravel Framwork?

1. php artisan main --version

2. php artisan --version status

3.php artisan check --version

4.php artisan --version


Question:
Command to check the status of migration in laravel application?

1.php artisan migration status

2.php artisan status

3.php artisan migrate:status

4.None of These


Question:
Command to create middleware in laravel application?

1.php artisan make:middleware Mymiddleware

2.php artisan middleware Mymiddleware

3.php artisan create:middleware Mymiddleware

4.php artisan middleware:make Mymiddleware


Question:
Command to Disable Maintenance Mode in laravel?

1.php artisan up

2.php artisan up:maintenance

3.php artisan up:live

4.None of These


Question:
Command to enable maintenance mode in laravel?

1.php artisan down

2.php artisan down:maintenance

3.php artisan maintenance

4. None of these


Question:
Command to get the route list in Laravel?

1.php artisan list

2.php artisan route:list

3.php artisan route

4.php artisan list:all


Question:
Command to install laravel project?

1.composer create-project laravel/laravel myproject

2.composer new-project laravel/laravel myproject

3.composer create-project new laravel/laravel myproject

4.None of these


Question:
Command to make migration in laravel?

1.php artisan migration table

2.php artisan make:migration create_tags_table

3.php artisan make-migration digit

4.None of these


Question:
Command to roll back migration operation in laravel?

1.php artisan rollback

2.php artisan migration:rollback

3.php artisan migrate:rollback

4.php artisan rollback migration


Question:
Command to rollback all migrations operations?

1.php artisan migrate:reset

2. php artisan migration:reset

3.php artisan reset

4.php artisan reset:migration


Question:
Command to start Laravel Application?

1.php artisan new

2.php artisan

3.php artisan start

4.php artisan serve


Question:
Full form of ORM in laravel?

1.Object Relation Mapping

2.Object Relation Master

3.Object Relation Manager

4.None of These


Question:
How to create a controller in laravel by cmd?

1.php artisan make: generate controller contoller_name

2.php artisan make:controller generate

3.php artisan make:controller --plain

4.php artisan make:request controller_name create


Question:
How to set a session data in Laravel?

1.$request->db->session('key', 'value');

2.$request->session()->set('key', 'value');

3.$request->session()->put('key', 'value');

4.None of These


Question:
In which directory robots.txt file is located?

1.models

2.public

3.views

4.controllers


Question:
In which folder .htaccess file is located in laravel?

1.model

2.controller

3.route

4.public


Question:
Laravel is based on which design pattern?

1.Singleton Design Pattern

2.MVC(Model View Controller) Pattern

3.Factory Design pattern

4.Observer pattern


Question:
Method to create Hash password in laravel?

1.$hashed = Hash::create('has-text');

2. $hashed = Hash::all('has-text');

3.$hashed = Hash::make('has-text');

4.None of these


Question:
Method to determine if the user is authenticated?

1.Auth::check()

2.Auth::user()

3.Auth::authenticated()

4.None of the these


Question:
Method to logout authenticated user from other devices in laravel?

1.Auth::logoutOtherDevices($currentPassword);

2.Auth::logoutAllDevices($currentPassword);

3.Auth::logout($currentPassword);

4.None of these


Question:
Method to logout authenticated user in laravel?

1.Auth::signout();

2.Auth::logout();

3.Auth::forgot();

4.None of these


Question:
The vendor directory contains

1. Laravel Framework code

2.Assets

3.Third-party code

4.Configuration files


Question:
The vendor directory contains in laravel?

1.Bootstrap dependencies

2.Laravel dependencies

3.Composer dependencies

4.None of These


Question:
What is laravel?

1.Framework

2.Programming Language

3.Code Editor

4.None of these


Question:
What is the HTTP Status Code for your website. When it is down for maintenance.

1. 501

2.200

3.400

4.503


Question:
What is the use of .env file in Laravel?

1.Setting Up local Environment variable

2.Optimization

3.Hosting

4.None of these


Question:
Which artisan command is used to remove the compiled class file.

1. clear-compiled

2.clear compiled

3.compiled:clear

4.clear:all


Question:
Which artisan command is used to remove the compiled class file.

1. clear-compiled

2.clear compiled

3.compiled:clear

4.clear:all


Question:
Which command is used to cache configuration in laravel?

1.php artisan cache:everything

2.php artisan cache:config

3. php artisan config:cache_all

4.php artisan config:cache


Question:
Which method breaks the collection into multiple, smaller collections of a given size

1.split()

2.chunk()

3.explode()

4.break()


Question:
Which method returns the average value of a given key ?

1. average()

2.avg()

3.median()

4.avg_val()


Question:
Who Created Laravel?

1.Margon Stan

2.Taylor Otwell

3.Samsy Twig

4.None of these


Question:
Who developed Laravel?

1. Rasmus Lerdorf

2.Taylor Otwell

3. James Gosling

4. Guido van Rossum


Question:
Who developed Laravel?

1. Rasmus Lerdorf

2.Taylor Otwell

3. James Gosling

4. Guido van Rossum


More MCQS

  1. Laravel MCQ (Multiple Choice Question) Set 1
  2. Laravel MCQ (Multiple Choice Question) Set 2
Search