Question - 1
How to enable maintenance mode in Laravel 5?
- php artisan down
- php artisan Up
- php artisan exit
- php artisan -m
Solutions
Answer- A
Question - 2
How to use skip() and take() in Laravel Query?
- $posts = DB::table('user')->skip(5)->take(10)->get();
- $posts = DB::table('user')->take(10)->skip(5)->get();
- $posts = DB::table('user')->skip_take(5,10)->get();
- None of these
Solutions
Answer- A
Question - 3
How We can use whereBetween() method to retrieve the data between two dates with Query?
- User::whereBetween('created_at', [$date1, $date2])->get();
- User::where('created_at')->Between(, [$date1, $date2])->get();
- Both A & B
- None of these
Solutions
Answer- A
Question - 4
How can we check the Laravel current version?
- Php artisan - L version
- Php artisan -version
- Php artisan -Laravel version
- None of these
Solutions
Answer- B
Question - 5
- Dump and Die
- Dump and dual
- Dummy and Die
- None of these
Solutions
Answer- A
Question - 6
How to rollback a particular migration in laravel?
- php artisan mi:rollback --step=1
- php artisan migrate:rollback
- php artisan migrate:rollback --step=1
- None of these
Solutions
Answer- C
Question - 7
- composer require laravel/tinker
- composer require tinker/laravel
- composer require tinker
- None of these
Solutions
Answer- A
Question - 8
Which database not support by laravel?
- MySQL
- PostgreSQL
- SQL Server
- Oracle
Solutions
Answer- D
Question - 9
How to create a constant in Laravel and used in Globally.?
- Config::get('constants.VaribleName');
- Config::get('constants,VaribleName');
- Config::get('constants')->('VaribleName');
- None of these
Solutions
Answer- A
Question - 10
Last Insert ID in Laravel
- DB::getPdo()->lastInsertId();
- DB::get()->lastInsertId();
- DB::getPdo()->last_InsertId();
- DB::getPdo()->last_Insert_Id();
Solutions
Answer- A
Question - 11
How to set cookies in Laravel?
- Cookie::queue($name, $value, $minutes);
- Cookie::Set($name, $value, $minutes);
- Cookie::withCookie($name, $value, $minutes);
- None of these
Solutions
Answer- A
Question - 12
Which type of relationship is not in Laravel Eloquent.
- One To One
- One To Many
- Polymorphic Relations
- None of these
Solutions
Answer- D
Question - 13
How to enable query log in Laravel?
- DB::connection()->enableQueryLog();
- $queries = DB::getQueryLog();
- Both A & B
- None of these
Solutions
Answer- A
Question - 14
- php artisan down
- php artisan up
- php artisan die
- None of these
Solutions
Answer- B
Question - 15
- $request->session()->Set('key', 'value');
- $request->session()->put('key', 'value');
- $request->session('key', 'value');
- None of these
Solutions
Answer- B
Question - 16
- $request->session()->delete('key');
- $request->session()->forget('key');
- $request->session()->unset('key');
- $request->session()->unlink('key');
Solutions
Answer- B
Question - 17
What is use of .env in Laravel?
- For setting environment variables
- For running cron jobs
- Verify Log files
- None of these
Solutions
Answer- A
Question - 18
Which method breaks the collection into multiple, smaller collections of a given size
- split()
- chunk()
- implode()
- Break()
Solutions
Answer- B
Question - 19
- It does not remove the data from the table. It is used to flag any record as deleted.
- remove all record from the database table.
- It truncate the table data.
- None of these
Solutions
Answer- A
Question - 20
- To display the contents of a given
- To extend an layout
- To include a file
- None of these
Solutions
Answer- A
Practice more set questions