laravel 5 Set 3
Free Online Best laravel 5 MCQ Questions for improve your basic knowledge of laravel 5. This laravel 5 set 3 test that contains 25 Multiple Choice Questions with 4 options. You have to select the right answer to a question.
Start
Congratulations - you have completed laravel 5 Set 3.
You scored %%SCORE%% out of %%TOTAL%%.
Your performance has been rated as %%RATING%%
Your answers are highlighted below.
Question 1 |
Which is Correct count() methods in Laravel?
A | DB::table(‘products’)->all(); |
B | DB::table(‘products’)->count(); |
C | DB::table(‘products’)->get(); |
D | DB::table(‘products’)->sum(); |
Question 2 |
How to use select query in Laravel?
A | DB::get('select * from users where city_id = ?', 10); |
B | DB::select('select * from users where city_id = ?', 10); |
C | DB::find('select * from users where city_id = ?', 10); |
D | DB::selectuser('select * from users where city_id = ?', 10); |
Question 3 |
Which database not support by laravel?
A | MySQL |
B | PostgreSQL |
C | SQL Server |
D | Oracle |
Question 4 |
How will you check table is exists or in the database?
A | TableExist() |
B | hasTable() |
C | readTable() |
D | None of these |
Question 5 |
How to get Logged in user info in laravel ?
A | Auth::Userinfo() |
B | Auth::User() |
C | Get::User() |
D | Auth::Userdata() |
Question 6 |
How to use delete Statement in Laravel?
A | DB::deleteUser('delete from users where id = ?', [1015]); |
B | DB::delete('insert from users where id = ?', [1015]); |
C | DB::deleteInfo('delete from users where id = ?', [1015]); |
D | DB::delete('delete from users where id = ?', [1015]); |
Question 7 |
How can we get data between two dates using Query in Laravel?
A | Blog::whereBetween('created_at', [$date1, $date2])->get(); |
B | Blog::Between('created_at', [$date1, $date2])->get(); |
C | Blog::where('created_at', [$date1, $date2])->find(); |
D | Blog::whereDate('created_at', [$date1, $date2])->get(); |
Question 8 |
In default Laravel 5 Auth, when user fills in email in "Forgot password", where the generated token is stored?
A | in database table "password_reset" |
B | in database table "userst" |
C | in password.php |
D | in user session |
Question 9 |
Which is Correct sum() methods in Laravel?
A | DB::table(‘orders’)->add(‘price’); |
B | DB::table(‘orders’)->all(‘price’); |
C | DB::table(‘orders’)->total(‘price’); |
D | DB::table(‘orders’)->sum(‘price’); |
Question 10 |
Which methods are used in database migrations classes?
A | up() and down() |
B | run() and delete() |
C | save() and update() |
D | execute() and rollback() |
Question 11 |
In which file we need to set the database connection in Laravel?
A | .ENV file |
B | setting.php |
C | config.php |
D | web.php |
Question 12 |
What will this function info('Some helpful information!') do?
A | write text to the log |
B | show text in browser |
C | send email |
D | none of these |
Question 13 |
How to use skip() and take() in Laravel Query?
A | $posts = DB::table('user')->take(10)->skip(5)->get(); |
B | $posts = DB::table('user')->skip(5)->take(10)->get(); |
C | $posts = DB::table('user')->skip_take(5,10)->get(); |
D | None of these |
Question 14 |
Which method returns the average value of a given key ?
A | average() |
B | avg() |
C | avg_val() |
D | median() |
Question 15 |
In default Laravel out-of-the-box "users" DB table migration, what field is not present?
A | surname |
B | name |
C | remember_token |
D | updated_at |
Question 16 |
What would this touch() function do?
A | update updated_at to current timestamp |
B | store a user object in cache |
C | created a new filed in database |
D | None of these |
Question 17 |
How can get the last (newest) registered user?
A | DB::table('users')->last()->first(); |
B | DB::table('users')->new()->first(); |
C | DB::table('users')->latest->first(); |
D | DB::table('users')->get()->first(); |
Question 18 |
Which method doesn't exist in default resource Controller of Laravel?
A | destroy |
B | show |
C | list |
D | crate |
Question 19 |
How to create migration via artisan?
A | php artisan share:migration create_users_table |
B | php artisan create:migration create_users_table |
C | php artisan make:migration create_users_table |
D | php artisan share:migration create_users_table |
Question 20 |
How We can use whereBetween() method to retrieve the data between two dates with Query?
A | User::whereBetween('created_at', [$date1, $date2])->get(); |
B | User::where('created_at')->Between(, [$date1, $date2])->get(); |
C | Both A & B |
D | None of these |
Question 21 |
The command "php artisan make:controller PhotoController --resource" will create Controller class with how many methods?
A | 4 |
B | 6 |
C | 5 |
D | 7 |
Question 22 |
Which is Correct max() methods in Laravel?
A | DB::table(‘orders’)->high(‘price’); |
B | DB::table(‘orders’)->max(‘price’); |
C | DB::table(‘orders’)->top(‘price’); |
D | DB::table(‘orders’)->all(‘price’); |
Question 23 |
What is softDeletes();
A | It does not remove the data from the table. It is used to flag any record as deleted. |
B | remove all record from the database table. |
C | It truncate the table data. |
D | None of these |
Question 24 |
How to hash password in Laravel 5?
A | Hash::make |
B | Hash::create |
C | Hash::run |
D | Hash::sql |
Question 25 |
Last Insert ID in Laravel
A | DB::getPdo()->last_InsertId(); |
B | DB::get()->lastInsertId(); |
C | DB::getPdo()->lastInsertId(); |
D | DB::getPdo()->last_Insert_Id(); |
Once you are finished, click the button below. Any items you have not completed will be marked incorrect.
Get Results
There are 25 questions to complete.
← |
List |
→ |
Return
Shaded items are complete.
1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 |
End |
Return
You have completed
questions
question
Your score is
Correct
Wrong
Partial-Credit
You have not finished your quiz. If you leave this page, your progress will be lost.
Correct Answer
You Selected
Not Attempted
Final Score on Quiz
Attempted Questions Correct
Attempted Questions Wrong
Questions Not Attempted
Total Questions on Quiz
Question Details
Results
Date
Score
Hint
Time allowed
minutes
seconds
Time used
Answer Choice(s) Selected
Question Text
All done
Need more practice!
Keep trying!
Not bad!
Good work!
Perfect!