Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 4 MCQs URL Generation, Request Data and Emails

INT221 — Mvc Programming 50 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 50 answered 0 right 0 wrong , 50 left

  1. Question 1 of 50

    In Laravel, which method on the Illuminate\Http\Request instance is used to retrieve all input data as an array?

  2. Question 2 of 50

    How can you retrieve a specific input value named 'username' from the request, returning 'Guest' if the value is not present?

  3. Question 3 of 50

    Which method is used to determine if a value is present on the request?

  4. Question 4 of 50

    When handling a boolean input like a checkbox that might return "true", "on", or "1", which method retrieves it as a boolean true or false?

  5. Question 5 of 50

    Which request method allows you to retrieve a subset of the input data?

  6. Question 6 of 50

    Which HTML attribute is mandatory for a form to upload files successfully?

  7. Question 7 of 50

    How do you verify that an uploaded file was successfully uploaded and is valid?

  8. Question 8 of 50

    Which method is typically used to store an uploaded file to a configured disk?

  9. Question 9 of 50

    How can you retrieve the original file extension of an uploaded file?

  10. Question 10 of 50

    Which method generates a SHA-256 hash of the uploaded file's contents to use as a filename?

  11. Question 11 of 50

    In Laravel, how does the framework handle input from the previous request to repopulate forms after validation errors?

  12. Question 12 of 50

    Which global helper function is used in Blade templates to retrieve old input?

  13. Question 13 of 50

    When redirecting, how do you chain a method to flash the current input to the session?

  14. Question 14 of 50

    By default, Laravel cookies are encrypted and signed. What does this prevent?

  15. Question 15 of 50

    How do you retrieve a cookie value from the incoming request?

  16. Question 16 of 50

    Which method allows you to attach a cookie to a response instance?

  17. Question 17 of 50

    What is the helper function to generate a cookie instance?

  18. Question 18 of 50

    Which Artisan command is used to create a new Mailable class?

  19. Question 19 of 50

    In a Mailable class, which method is used to configure the email content (e.g., view, subject)?

  20. Question 20 of 50

    Which method is used on the Mail facade to specify the recipient?

  21. Question 21 of 50

    How do you attach a file to an email within the build method of a Mailable?

  22. Question 22 of 50

    To queue an email for background sending instead of sending it immediately, which method should be used?

  23. Question 23 of 50

    Which directory stores the language files for Laravel Localization?

  24. Question 24 of 50

    How do you retrieve a translation string for the key 'welcome' located in messages.php?

  25. Question 25 of 50

    What is the Blade directive equivalent to <?php echo __('messages.welcome'); ?>?

  26. Question 26 of 50

    If a translation string contains a placeholder like Welcome, :name, how do you replace it?

  27. Question 27 of 50

    Which method allows you to change the application's current locale at runtime?

  28. Question 28 of 50

    Which function is used for pluralization of translation strings based on a count?

  29. Question 29 of 50

    Where is the default application locale configured?

  30. Question 30 of 50

    Which configuration file handles the session settings?

  31. Question 31 of 50

    How can you access session data using the global helper?

  32. Question 32 of 50

    What is the syntax to store data in the session using the helper function?

  33. Question 33 of 50

    Which method is used to push a new value onto a session array?

  34. Question 34 of 50

    How do you retrieve an item from the session and delete it in a single statement?

  35. Question 35 of 50

    Which method checks if a key exists in the session, returning true even if the value is null?

  36. Question 36 of 50

    How do you remove a specific piece of data from the session?

  37. Question 37 of 50

    Which method removes all data from the session?

  38. Question 38 of 50

    To prevent session fixation attacks, which method should be called typically during authentication?

  39. Question 39 of 50

    How do you store items in the session only for the next request?

  40. Question 40 of 50

    If you need to keep flashed data for one more additional request, which method do you use?

  41. Question 41 of 50

    In the context of MVC and URL generation, what function is used to generate a URL to a named route?

  42. Question 42 of 50

    If a route is defined as Route::get('/post/{id}', ...)->name('post.show'), how do you generate the URL for ID 5?

  43. Question 43 of 50

    Which Request method gives you the full URL including the query string?

  44. Question 44 of 50

    How can you access the query string parameters as an array?

  45. Question 45 of 50

    When storing session data, which driver stores sessions in a file within storage/framework/sessions?

  46. Question 46 of 50

    Using the database session driver requires what preliminary step?

  47. Question 47 of 50

    In Localization, what is the fallback locale?

  48. Question 48 of 50

    If you want to increment a value in the session, which logic is most appropriate?

  49. Question 49 of 50

    What is the primary difference between $request->input() and $request->query()?

  50. Question 50 of 50

    If $x is a Request instance, what does $x->collect() return?

That's unit 4

Answer a few questions and your score shows up here.