1. Which of the following command is used to create controller?
A. php artisan makes: controller WelcomeController
B. php artisans make: controller WelcomeController
C. php artisan make: controllers WelcomeController
D. php artisan make: controller WelcomeController
2. Static content view, you don’t need to create controller?
a. True b
. False
3. Which file defines your application URL?
A. controller
B. route
C. model
D. helper
4. Which of the following is not correct?
A. return view (“home”) ->with (‘city’, $city);
B. return view (“home”) ->with ($city, ‘city’);
C. return view (“home”) ->with (‘city’, ‘city’);
D. none of above
5. It is possible to create a controller alias?
a. True
b. False
6. It is possible to use multiple “with” method in view files?
a. True
b. False
9. Which of the following is false?
a. @extends directive tells which layout should be used
b. The file extension of view should be like “example.blade.php”
c. @yield directive identifies the id of section
d. None of above
11.Which of the following command is used to create the model?
A. php artisan makes: modelWelcomeModel
B. php artisans make: model WelcomeModel
C. php artisan make: modelsWelcomeModel
D. php artisan make: modelWelcomeModel
12. Laravel currently supports databases, including
a. MySQL, PostgreSQL, SQLite, Microsoft SQL Server
b. MySQL, Oracle, SQLite, Microsoft SQL Server
c. MySQL, PostgreSQL, SQLite, Microsoft Access
d. MySQL, SQLite
13. App directory contains
a. Controller, Middleware
b. Model, View, Controller
c. Model, Controller, Middleware
14. Artisan is a
a. Plugins
b. Api
c. Command line interface
d. Cmd
15. The bootstrap directory used to
a. Initialize a laravel application
b.Call laravel library functions
c. Load the configuration files
d. Load level classes and models
e. Define the key directory of app and public
16. The primary function of the composer is
a. Installing and updating required application package
b. Configuring laravel application
c. Creating da database in the laravel
17. What is composer.json?
a. This file identifies the packages you like to integrate into your application.
b. This file is used to configure the composer package manager.
c. This is used to regularly maintain your application package.
18. What is the composer?lock file used for?
a. It is used to contain information about the state of the installed composer package at the time when packages were first installed and/or updated.
b. It is used to contain information about the state of the installed composer package at the time these packages were last installed and/or updated.
c. It is used to lock all the packages so that it would never change later.
19. Which directory is used to store database credentials, the cache, e-mail delivery and session settings?
a. Database
b. Session
c. Config
d. Public
e. Resources
20. Public directory serves as your application’s root directory.
a. True
b. False
21. Which directory houses .htaccess, robots.txt and favicon files?
a. Config
b. Public
c. Model
d. Resources
22. The resources directory contains
a. Raw assets (CoffeeScript, SCSS, etc.)
b. Views
c. Models
d. Templates
23. The vendor directory contains
a. Third-party code
b. Controllers
c. Laravel framework code
d. Assets
24. Which command is used to start PHP’s built-in development server?
a. %> php start server
b. %> php start dev server
c. %> php artisan serves
d. %> php artisan server
25. App.php file contains the settings for
a. Time zone
b. Time zone, autoloaded service providers, debug mode
c. Security
d. Authentication
26. Which artisan CLI command is used to update your project’s namespace?
a. %> php artisan update app
b. %> php artisan app: name my_project
c. %> php artisan update:my_app
d. %> php artisan namespace:my_app
27. Cache.php supports caching drivers including
a. file system, database
b. the file system, database, mem-cached, redis
c. the file system, mem-cached, redis
28. Compile.php file is for
a. Executing package auto loading
b. Define additional class file
c. Executing all controllers
d. None
29. Which of the following are not Laravel configuration files?
a. Mail.php
b. Queue.php
c. Services.php
d. View.php
e. Config.php
f. App.php
30. Which configuration file defines any third-party service-specific settings?
a. Filesystems.php
b. Session.php
c. Services.php
d.Third-party.php
e. Broadcasting.php
31. Which is not laravel logging function?
a. \Log::debug ()
b. \Log::info ()
c. \Log::warning ()
d. \Log::error ()
e. \Log::critical ()
f. \Log::print_errors()
32. Where to find log files in laravel?
a. Storage\logs
b. App\logs
c. Resources\Logs
d. Public\Logs
33. Which is the correct syntax to making GET request in laravel?
a. Route::get (‘/’,function(){ … });
b. Route::post (‘/’, function () {…});
c. Route::request (‘/’, function () {…});
d. Get::route (‘/’, function () {…});
34. Which is the correct syntax to call a view from a router in laravel which is located at resources/views/product/items.blade.php directory?
a. Return view (“items”)
b. Return view (“items.blade.php”)
c. Return view (“product/items”)
d. Return view (“product.items”)
e. Return view (“view/product/items”)
35. Which is the correct path to saving controller files in laravel?
a. Resources/controllers
b. App/controllers
c. App/Http/controllers
d. Controllers
36. Which is the correct path to save models in the laravel?
a. Resources/Models
b. App/Models
c. App/Http/Providers
d. App/
37. How to create controller using artisan?
a. $ php artisan make: controller [Controller Name]
b. $ php artisan make: Controller [Controller Name]
c. $ php artisan make:[Controller Name] controller
d. $ artisan make:[Controller Name] controller
38. Which is the parent class to make a new controller?
a. AppController
b. Controller
c. LController
d. MyController
39. Which namespace is used to handle the entire form request in laraval?
a. Use Illuminate\Http\Requests
b. Use Illuminate\Http\Request
c. Use App\Requests
d. Use App\Http\Request
40. Which router indicates the view is loaded via the controller class?
a. Rout::get (‘/’,’MyController@index’);
b. Rout::get (‘/’, function () {…});
c. Route::get (‘/’, function () {return view (‘index’)});
d. None
41. What is a blade in Laravel?
a. A plugin
b. A template engine
c. An API
d. A Helper
42. Which is the correct syntax to pass multiple variables to the view?
a. return view('home')->with('projects',$projects)->with('modules',$modules)
b. return view('home')->with(array('projects'=>$projects,'modules'=>$modules))
c. return view('home’, array('projects'=>$projects, ‘modules'=>$modules)))
43. Which is the correct way to configure local database to the laravel?
a. Configure app/Config/database.php file
b. Configure Config/database.php file
c. Configure .env file
44. Which namespace is used to make available DB object?
a. Use Database
b. Use DB
c. Use MySql
d. Use DB_ALL
45. Which function is used to get all records from product table?
a. $result=DB:: table('product')->getAll();
b. $result=DB:: table('product')->get();
c. $result=DB:: get('product')->table();
d. $result=DB->table ('product') ->get ();
46. Which function is used to redirect request to project root?
a. return header('/');
b. return head('/');
c. return redirect(/');
d. return redirect('/home');
47. Which convention is used to make view for blade engine? [* indicate any file name]
a. *.b.php
b. *.be.php
c. *.blade.php
d. *.php
49. How can you determine variable existence in blade expression?
a. {{if ($name)?$name: ’Default Value’ }}
b. {{$name or ‘Default Value’ }}
c. {{ isset($name)?$name: ‘Default Value’}}
50. Which blade engine expression is used to escaping dangerous input?
a. {{ … }}
b. {{{ … }}}
c. {!! … !!}
d. {! … !}
51. Which is the correct looping syntax in term of blade engine?
a. @foreach($lists as $list) … @endforeach
b. @for ($i=0;$i<len($list);$i++) … @endfor
c. @while … @endwhile
d. None
52. Which is the correct forelse syntax in blade engine?
a. @for … @else … @endfor
b. @forelse … @empty … @endforelse
c. @forelse … @else … @endforelse
d. None
53. Which of the following is correct selection syntax for blade engine?
a. @if … endif
b. @if … @else … @endif
c. @if … @elseif … @endif
d. @if … @if .. @end @end
54. Which is not a correct directive for blade engine?
a. @yield
b. @section
c. @parent
d. @show
e. @content
55. Which function is used to link external CSS file in blade engine?
a. {! HTML::css(‘path’) !}
b. {!! HTML:: style (‘path’)!!}
c. {{HTML:: css(‘path’) }}
d. {{HTML:: style (‘path’)}}
56. Which function is used to link external JS file in blade engine?
a. {! HTML:: js(‘path’) !}
b. {!! HTML:: javascript(‘path’) !!}
c. {{HTML:: script (‘path’) }}
d. {!!HTML:: script (‘path’)!!}
57. ORM stands for
a. Object Relation Management
b. Object Relationship Management
c. Object Relational Mapping
d. Object Relational Management
58. How can you create model in larvae using artisan command?
a. $ php artisan make: model [Model_name]
b. $ php artisan creates: model [Model_name]
c. $ php artisan make: [Model_name] model
d. $ artisan make: [Model_name] model
59. Which is the correct artisan command to make a migration in laravel?
a. $ php artisan migrate
b. $ php artisan migration
c. $ php artisan table migrate
d. None
60. Which command is used to see migration status?
a. $ php artisan migrate status
b. $ php artisan migrates status
c. $ php artisan migration: status
d. None
61. In laravel assessors means _____
a. Member Functions
b. Events
c. Getter Functions
d. Setter functions
62. In laravel matadors means ______
a. Setter functions
b. Getter functions
c. Events
d. Member functions
63. Which variable is used to validate your model in laravel?
a. $validator
b. $validation
c. $rules
d. $validation_rules
64. Which function is used to retrieve a single record from a table by primary key in laravel?
a. App\MyModel::find_by_id()
b. App\MyModel::find_id()
c. App\MyModel:: find()
d. None
65. Which laravel function is used to make pagination?
a. {!! $data->render ()!!}
b. {!! $data->paginate ()!!}
c. {!! $data->pages ()!!}
d. None
66. CSRF stands for ______
(a) Cross System Rich Format
(b) Cross-Site Request Forgery
(c) Cross Scripting Reformative Function
(d) Cross Style Reporting Formula
67. What is the syntax to generate the form’s opening tags.
(a) Form::opening ()
(b) Form::close ()
(c) Form::open ()
(d) Form::start ()
68. Laravel supports only three types of relationships.
(a) True
(b) False
69. For creating form text fields Laravel uses ___
(a) Form::string
(b) Form::text area
(c) Form::text
(d) Form::submit
No comments:
Post a Comment