Aptitude Reasoning English GK Computer Knowledge Programming Skill Banking Software Testing



Question - 1

How to enable maintenance mode in Laravel 5?

  • php artisan down
  • php artisan Up
  • php artisan exit
  • php artisan -m
Solutions
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
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
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
Question - 5

dd() Stand for___

  • Dump and Die
  • Dump and dual
  • Dummy and Die
  • None of these
Solutions
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
Question - 7

How to install tinker?

  • composer require laravel/tinker
  • composer require tinker/laravel
  • composer require tinker
  • None of these
Solutions
Question - 8

Which database not support by laravel?

  • MySQL
  • PostgreSQL
  • SQL Server
  • Oracle
Solutions
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
Question - 10

Last Insert ID in Laravel

  • DB::getPdo()->lastInsertId();
  • DB::get()->lastInsertId();
  • DB::getPdo()->last_InsertId();
  • DB::getPdo()->last_Insert_Id();
Solutions
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
Question - 12

Which type of relationship is not in Laravel Eloquent.

  • One To One
  • One To Many
  • Polymorphic Relations
  • None of these
Solutions
Question - 13

How to enable query log in Laravel?

  • DB::connection()->enableQueryLog();
  • $queries = DB::getQueryLog();
  • Both A & B
  • None of these
Solutions
Question - 14

How to disable maintenance mode in Laravel?

  • php artisan down
  • php artisan up
  • php artisan die
  • None of these
Solutions
Question - 15

How to set Session Data in Laravel?

  • $request->session()->Set('key', 'value');
  • $request->session()->put('key', 'value');
  • $request->session('key', 'value');
  • None of these
Solutions
Question - 16

How to delete a session data in Laravel?

  • $request->session()->delete('key');
  • $request->session()->forget('key');
  • $request->session()->unset('key');
  • $request->session()->unlink('key');
Solutions
Question - 17

What is use of .env in Laravel?

  • For setting environment variables
  • For running cron jobs
  • Verify Log files
  • None of these
Solutions
Question - 18

Which method breaks the collection into multiple, smaller collections of a given size

  • split()
  • chunk()
  • implode()
  • Break()
Solutions
Question - 19

What is softDeletes();

  • 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
Question - 20

What is @yield used for?

  • To display the contents of a given
  • To extend an layout
  • To include a file
  • None of these
Solutions
Tags:
Laravel MCQ (Multiple Choice Questions), Advanced Laravel MCQ, Laravel MCQ Online test,Laravel MCQ Questions and answers PDF, Laravel Interview Questions With Answers, Laravel Technical Questions with full explanation