Question - 1
Where do we need to set database connection in Laravel?
setting.php
config.php
.ENV file
In seed files
Show Answer
Solutions
Answer- C
Question - 2
In Laravel Interpolation done by using below which symbol/ file?
Answer- C
Question - 3
What would this touch() function do?
$obj= User::find(1);
$obj->touch();
store a user object in cache
update updated_at to current timestamp
created a new filed in database
None of these
Show Answer
Solutions
Answer- B
Question - 4
After running "artisan down", The project will show the maintenance page. What would be HTTP Status return Code?
Answer- B
Question - 5
Which directory contain “robot.txt” file ?
Answer- A
Question - 6
What is the minimum PHP version required to install Laravel 5.3?
Answer- A
Question - 7
$user = DB::table('users')->SomeName()->first(); For getting newest registered user, In above function What would be the below options replace by SomeName.
latest
last
newest
last_user
Show Answer
Solutions
Answer- A
Question - 8
Which functions are used for database migration classes?
up() and down()
migrate() and upmigrate()
insert() and rollback()
None of these
Show Answer
Solutions
Answer- A
Question - 9
How to set a session data in Laravel?
$request->session()->put('key', 'value');
$request->db->session('key', 'value');
$request->session()->set('key', 'value');
None of these
Show Answer
Solutions
Answer- A
Question - 10
Which directory not in side the app directory?
Broadcasting
resources
Console
Events
Show Answer
Solutions
Answer- B
Question - 11
How to create a controller in laravel by cmd?
php artisan make:controller generate
php artisan make:controller --plain
php artisan make: generate controller contoller_name
php artisan make:request controller_name create
Show Answer
Solutions
Answer- B
Question - 12
View files in Laravel end in which extension?
.blade.php
.php
.php.blade
.lar.php
Show Answer
Solutions
Answer- A
Question - 13
How to check current laravel version install your system?
php artisan --version
php artisan check --version
php artisan make --version
None of these
Show Answer
Solutions
Answer- A
Question - 14
Where is the routing file located in Laravel ?
routes/
config/
app/Http/
vendor/
Show Answer
Solutions
Answer- A
Question - 15
How to clear cache in Laravel?
php artisan cache: clear
php artisan config: clear
php artisan cache: clear
All of Above
Show Answer
Solutions
Answer- D
Question - 16
How to get IP address in Laravel?
$request->ip();
$request->ip_address();
$request->ipAddress();
None of these
Show Answer
Solutions
Answer- A
Question - 17
Object-relational Mapping
Object-Rotational Mechanisim
Object-related Modifier
Overloaded-relational Mapping
Show Answer
Solutions
Answer- A
Question - 18
Below options which come under Laravel array helper functions?
Arr::add()
Arr::has()
Arr::only()
All the above
Show Answer
Solutions
Answer- D
Question - 19
How to get current action name in Laravel?
request()->DB->getActionMethod()
request()->getActionMethod()
request()->route()->getActionMethod()
None of these
Show Answer
Solutions
Answer- C
Question - 20
How to get current route name?
request()->route()->getName()
request()->getName()
request()->route->getName()
None of these
Show Answer
Solutions
Answer- A
Practice more set questions