1. To validate a date named finish_date against following rules: -Should be date -Required -Should be greater than start_date which is correct validation rule?
2. To protect application from cross-site request forgery attacks, which should be included in forms?
3. Validation If checkbox ticked then Input text is required?
4. ____ are an important part of any web-based application. They help control the flow of the application which allows us to receive input from our users and make decisions that affect the functionality of our applications.
5. ___ web applications respond to meaningful HTTP verbs with appropriate data.
6. How to use laravel routing for unknown number of parameters in URL.
7. How access custom textbox name in Laravel using validation 'unique'?
8. The field under validation must be present in the input data and not empty. A field is considered 'empty' if one of the following conditions are true:
9. How do you define a single action controller for the following route? Route::get('user/{id}', 'ShowProfile');
10. _____ directory contains much of the custom code used to power your application, including the models, controllers and middleware.
11. If you need to add additional routes to a resource controller beyond the default set of resource routes, you should define those routes after your call to Route::resource
12. Which validation rules are acceptable?
13. Correct way to set SQLite as database for unit testing?
14. Which method can be used to create custom blade directives?
15. Which is correct to have an optional parameter in route?
16. Which is correct to create a route(s) to resource controller named 'PostController'?
17. Which method can be used to register a route that responds to all HTTP verbs?
18. How the Laravel controller method get the parameters?
19. Which is correct to define middleware for multiple views in controller file?
20. Which is/are correct to define custom validation messages?
21. Use a validation rules inside the custom validation class?
22. Which method can be used with models to build relationships?
23. Which can be used to create a controller with typical 'CRUD' routes?
24. To create a controller which handles all 'CRUD' routes, which is correct command?
25. If blog post has infinite number of comments we can define one-to-many relationship by placing following code in post model?
26. Which variable is available inside your loops in blade?
27. Which controller should be extended by all controllers?
28. Which view facade within a service provider's boot method can be used to share data with all views?
29. List out few different return types of a controller action method?
30. Which method can be used to store items in cache permanently?
31. \Config::set('database.connections.customers.database', 'db_A');
32. Which is correct for route definitions?
33. How to get Header Authorization key in controller?
34. To share route attributes, it is best to use route groups?
35. Which is a correct way to assign middleware 'auth' to a route?
36. Which file contains the database configurations?
37. If you don't want Eloquent to automatically manage created_at and updated_at columns, which of the following will be correct?
38. Which method is provided by migration class?
39. Which command should be used to run all outstanding migration?
40. Which method will retrieve the first result of the query in Laravel eloquent?
41. The migrations directory contains PHP classes which allow Laravel to update the Schema of your current __, or populate it with values while keeping all versions of the application in sync. Migration files must not be created manually, as their file name contains a timestamp. Instead usetheArtisanCLIinterfacecommand php artisan migrate:make to create a new Migration.
42. To retrieve all blog posts that have at least one comment. (Model has one to many relation already set up)
43. Eloquent can fire the following events allowing you to hook into various points in the model's lifecycle. (choose all that apply)
44. All eloquent models protect against mass-assignment by default.
45. Creating database view in migration laravel 5.2
46. Which is correct to get all rows from the table named users?
47. Which is correct to retrieve soft deleted models?
48. Which database is supported by Laravel 5?
49. Get only selected column from database table.
50. Which is correct to retrieve all comments which are associated with single Post (post_id = 1) with one to many relation in Model?
51. Which code is correct to insert multiple records?
52. Which is correct route methods?
53. Which is correct to get the URL of named route 'contact'?
54. Route parameters should not have underscore '_' character?
55. Which is true to get the URL of an image 'img/logo.png' from route '/example' ?
56. Which will list all routes?
57. Which is correct to display unescaped data in blade?
58. Which is correct to render the expression using javascript instead of blade?
59. Which is the last parameter for @each directive in blade?
60. Suppose we have a collection which contains the website news. What is the best way to share that collection in all views?
61. To reference a view view('user.profile', $data); Which is correct name and path for view file?
62. Which is correct for blade template?
63. Which is executed first?
64. Which is correct directory for view files?
65. The following option will allow you to upload an image with many to many relationships:
66. Which is shortcut for ternary statement in blade?
67. Which is correct syntax for passing data to views?
68. Which is correct to include a section('content') in your template?
69. Which facade can be used to get the current URL for the request?
70. Which is correct to delete a model with primary key 2?
71. Which can be included in route definition to validate form data?
72. Add default value to select list in form.
73. Using Form class to add the 'disabled' attribute for some options.
74. Which validator methods returns 'True' when form data is valid?
75. If we have a following URL http://myapp.dev/?foo=bar&baz=boo Which will get the values of 'foo' and 'baz'?
76. How to route when using URL query string?
77. To apply common properties to collection of routes we can use one of the following method?
78. Which is correct to create a model named 'Person' with accompanying migration?
79. Which artisan command is correct to create a model with table named 'projects'?
80. Which method can be used to apply common properties to collection of routes?
81. Which is convenient and correct way to automatically inject the model instances directly into your routes?
82. Which is correct to loop over an array named $lists in view?
83. Which can be used in views to print a message if array is empty?
84. To execute the following statement without error, which is correct? $flight = App\User::create(['name' => 'John Doe']);
85. To define a callback when view is rendered we can use:
86. Which is required before using @section and @endsection in blade file?
87. To get a single column from Database table we can chain one of the following method?
88. Which validation rule is correct to validate that the file is an image file having dimensions of min 200 height x min 400 width?
89. Output of following in view if $name = 'Andy'? Welcome, {{ $name or 'John' }}
90. Which loop is available in blade?
91. Which is correct to pass $name variable to views?
92. Which can be used in Schema::create() method?
93. Which can be used to add images in a view?
94. Which static method can be used with our models? (choose all that apply)
95. Which method should be used to alter the columns of an existing table?
96. Which is correct to redirect named route 'photos.index'?
97. Which is ignored by blade?
98. Which is correct form encoding for file uploads?
99. Which is correct command to save an uploaded file?
100. Which function can be used for named routes in your views?
101. Which php artisan command create tables in database on initial run?
102. How to escape output in blade?
103. Which is the correct code to select data from database?
104. Which HTML form actions are not supported?
105. Which DB facades allows you to execute raw commands or queries?
106. Which is valid blade directives? (Choose all that apply)
107. Which can be applied to route group? (Choose all that apply)
108. Which route is created by below route declaration? (Choose all that apply) Route::resource('photos', 'PhotoController');
109. Which valid validation rules? (Choose all that apply)
110. Which is correct regular expression route constraints?
111. Which is correct redirects? (Choose all that apply)
112. Which Request facades are available in Laravel? (Choose all that apply)
113. Which is correct route definitions? (Choose all that apply)
114. Which is the correct sample code to union two queries?
115. Which is correct Blade for/else syntax?
116. Which is route redirect methods? (Choose all that apply)
117. Which is true for Elixir and Gulp? (choose all that apply)
118. Which method can be used to retrieve the record as an object containing the column names and the data stored in the record?