Laravel

Laravel

Test your Laravel knowledge with free quizzes on MyCodeSkills covering core concepts.


  1. What is Laravel?

    • A JavaScript framework
    • A PHP framework
    • A CMS
    • A database
  2. What is the default templating engine used in Laravel?

    • Twig
    • Smarty
    • Blade
    • Mustache
  3. Which command is used to create a controller?

    • php artisan make:view
    • php artisan make:controller
    • php artisan controller:create
    • php artisan generate:controller
  4. Where are Laravel routes defined?

    • routes/web.php
    • config/web.php
    • resources/routes.php
    • app/routes.php
  5. Which function is used to define a GET route?

    • Route::view()
    • Route::controller()
    • Route::get()
    • Route::request()
  6. What is the purpose of Laravel middleware?

    • Database migration
    • Route protection
    • Blade templating
    • Authentication routes
  7. How do you define a middleware in Laravel?

    • php artisan make:route
    • php artisan make:guard
    • php artisan make:middleware
    • php artisan middleware:create
  8. Which file is used to register middleware globally?

    • routes/web.php
    • config/middleware.php
    • app/Http/Middleware.php
    • app/Http/Kernel.php
  9. What is the syntax to group routes with middleware?

    • Route::group(['middleware' => 'auth'], function(){})
    • Route::auth(['group'])
    • Route::group(['guard' => 'web'], function(){})
    • Route::authGroup([])
  10. What does Form Request class in Laravel do?

    • Handles routing
    • Handles view logic
    • Handles validation logic
    • Handles migrations
  11. What class is used to define a queued job in Laravel?

    • QueueClass
    • JobClass
    • Mailable
    • Controller
  12. How do you dispatch a job in Laravel?

    • Job::fire()
    • Job::call()
    • dispatch(new JobClass)
    • run(JobClass)
  13. What method is used in event listeners to handle an event?

    • handle()
    • process()
    • run()
    • execute()
  14. Laravel service container is mainly used for?

    • Middleware management
    • Controller injection
    • Dependency injection
    • Route filtering
  15. Which command creates a service provider?

    • php artisan make:serviceprovider
    • php artisan provider:create
    • php artisan make:provider
    • php artisan create:service