Laravel MCQ (Multiple Choice questions) For Freshers & Experienced

  • Question 1) Laravel is based on _____________________
  • Question 2) Which of following Collection method returns all records from Laravel collection?
  • Question 3) Which one Laravel command line interface?
  • Question 4) Which command is used to start laravel server
  • Question 5) Which of following command is used to remove the compiled class file in Laravel?
  • Question 6) How to list all routes by terminal?
  • Question 7) How to redirect to another page in Laravel?
  • Question 8) What is it Blade?
  • Question 9) What is @yield used for?
  • Question 10) How to define an mutator in Laravel?
  • Sammer
  • 08th Jan, 2020
  • 1089 Followers

Laravel MCQ (Multiple Choice questions)
Updated ON

08th Jan, 2020

No. of Questions

10

Posted In

MCQ

Author

Sammer

Laravel Online Quiz

Q1. Laravel is based on _____________________

  • MVVM Design Pattern
  • MVC Design Pattern
  • Singleton Design Pattern
  • Composite Design Pattern
View Answer
Laravel is based on MVC Design Pattern

Q2. Which of following Collection method returns all records from Laravel collection?

  • ->all()
  • ->get()
  • ->where()
  • ->whereAll()
View Answer
->all() method of laravel colection return all records
Example:
$collection=collect([1,2,3,4,5]);
$collection->all();

Q3. Which one Laravel command line interface?

  • CLI
  • php artisan
  • composer
  • git
View Answer
php artisan is command line interface for Laravel.

Q4. Which command is used to start laravel server

  • php artisan serve
  • php artisan start
  • php artisan start-server
  • php artisan project_name
View Answer
php artisan serve command is used to start laravel server

Q5. Which of following command is used to remove the compiled class file in Laravel?

  • php artisan clear-class
  • php artisan clear-compiled
  • php artisan down
  • php artisan inspire
View Answer
php artisan clear-compiled command is used to remove the compiled class file in Laravel.

Q6. How to list all routes by terminal?

  • php artisan routes
  • php artisan getroutes
  • php artisan route:list
  • php artisan listroutes
View Answer
php artisan route:list commnad is used to list all routes by terminal.

Q7. How to redirect to another page in Laravel?

  • return redirect::toview('/name')
  • return redirect('/name')
  • return redirect::('/name')
View Answer
return redirect('/name') is correct way to redirect to another page in Laravel?

Q8. What is it Blade?

  • Template Engine
  • package
  • view file
  • framework
View Answer
Blade is a Template Engine.

Q9. What is @yield used for?

  • to display the contents of a given section.
  • to extend an layout
  • to include a file
View Answer
@yield used to display the contents of a given section.

Q10. How to define an mutator in Laravel?

  • setNameAttribute method inside model
  • setNameAttribute method inside controller
  • setMutator method inside controller
View Answer
setNameAttribute method inside model is used to define an mutator in Laravel

About Author :

  • Author of Laravel MCQ (Multiple Choice questions)

    Sammer Kumar

    Hi myself is Sammer. I am web developer from Pune, Maharastra who codes in PHP programming languages and its frameworks like Laravel, cakephp, Yii, and Zend. Apart of coding I love to write technical blogs and help junior developer to crack their interview on php.

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.