MCQs > Website Designing & Development > Laravel Framework MCQs > Basic Laravel Framework MCQs

Basic Laravel Framework MCQ

1.

Which of the following methods can be used to retrieve the record as an object containing the column names and the data stored in the record?

Answer

Correct Answer: get()

Note: This Question is unanswered, help us to find answer for this one

2.

Which of the following is true for Elixir and Gulp? (choose all that apply)

Answer

Correct Answer: Elixir is built on top of Gulp, so to run your Elixir tasks you only need to run the gulp
The gulp watch command will continue running in your terminal and watch your assets for any changes.
Adding the --production flag to the command will instruct Elixir to minify your CSS and JavaScript files

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

3.

Which of the following are route redirect methods? (Choose all that apply)

Answer

Correct Answer: home()
refresh()
away()
secure()

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

4.

Which of the following is correct Blade for/else syntax?

Answer

Correct Answer: @forelse ($users as $user) {{ $user->first_name }} {{ $user->last_name }}
@empty No users. @endforelse

Note: This Question is unanswered, help us to find answer for this one

5.

Which of the following is the correct sample code to union two queries?

Answer

Correct Answer: $first = DB::table('contacts') ->whereNull('first_name'); $contacts = DB::table('contacts') ->whereNull('last_name') ->union($first) ->get();

Note: This Question is unanswered, help us to find answer for this one

6.

Which of the following are correct route definitions? (Choose all that apply)

Answer

Correct Answer: Route::match(['get', 'post'], '/', function () {});
Route::any('/', function () {});
Route::delete('/', function () {});
Route::put('/', function () {});

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

7.

Which of the following Request facades are available in Laravel? (Choose all that apply)

Answer

Correct Answer: Request::all()
Request::except()
Request::has()
Request::get()

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

8.

Which of the following are correct redirects? (Choose all that apply)

Answer

Correct Answer: Route::get('redirect-with-facade', function () { return Redirect::to('auth/login'); });
Route::get('redirect-with-helper', function () { return redirect()->to('auth/login'); });
Route::get('redirect-with-helper-shortcut', function () { return redirect('auth/login'); });

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

9.

Which of the following are valid validation rules? (Choose all that apply)

Answer

Correct Answer: 'name' => 'required|max:255'
'email' => 'email'
'website' => ['regex:/^((?:https?\:\/\/|www\.)(?:[-a-z0-9]+\.)*[-a-z0-9]+.*)$/']
're_occurance_end_date' => 'required_if:repeat_appointment,daily,weekly,monthly,yearly'

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

10.

Which of the following routes are created by below route declaration? (Choose all that apply) Route::resource('photos', 'PhotoController');

Answer

Correct Answer: /photos
/photos/create
/photos/{photo}/edit

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

11.

Which of the following can be applied to route group? (Choose all that apply)

Answer

Correct Answer: middleware
prefix
domain
namespace

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

12.

Which of the following are valid blade directives? (Choose all that apply)

Answer

Correct Answer: @if, @else, @elseif, and @endif
@unless and @endunless
@for, @foreach, and @while
@forelse, @empty and @endforelse

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

13.

Which of the following DB facades allows you to execute raw commands or queries?

Answer

Correct Answer: DB::select
DB::insert
DB::update

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

14.

Which of the following HTML form actions are not supported?

Answer

Correct Answer: PUT
DELETE
PATCH

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

15.

Which of the following is the correct code to select data from database?

Answer

Correct Answer: DB::select('select * from users');

Note: This Question is unanswered, help us to find answer for this one

16.

How to escape output in blade?

Answer

Correct Answer: {!! $stuffToEcho !!}

Note: This Question is unanswered, help us to find answer for this one

17.

Which of the following php artisan command create tables in database on initial run?

Answer

Correct Answer: php artisan migrate

Note: This Question is unanswered, help us to find answer for this one

18.

Which of the following function can be used for named routes in your views?

Answer

Correct Answer: route()

Note: This Question is unanswered, help us to find answer for this one

19.

Which of the following is correct command to save an uploaded file?

Answer

Correct Answer: $request->file('avatar')->store('avatars');

Note: This Question is unanswered, help us to find answer for this one

20.

Which one of the following is correct form encoding for file uploads?

Answer

Correct Answer: <form method="post" enctype="multipart/form-data">

Note: This Question is unanswered, help us to find answer for this one

21.

Which of the following is ignored by blade?

Answer

Correct Answer: @{{ $variable }}

Note: This Question is unanswered, help us to find answer for this one

22.

Which of the following is correct to redirect named route 'photos.index'?

Answer

Correct Answer: Route::get('redirect', function () { return Redirect::route('photos.index'); });

Note: This Question is unanswered, help us to find answer for this one

23.

Which of the following methods should be used to alter the columns of an existing table?

Answer

Correct Answer: Schema::table()

Note: This Question is unanswered, help us to find answer for this one

24.

Which of the following static methods can be used with our models? (choose all that apply)

Answer

Correct Answer: ::find()
::destroy()
::all()

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

25.

Which of the following can be used to add images in a view?

Answer

Correct Answer: <img src="{{ URL::asset('img/myimage.png') }}" alt="a picture"/>

Note: This Question is unanswered, help us to find answer for this one

26.

Which of the following can be used in Schema::create() method?

Answer

Correct Answer: $table->string('username');

Note: This Question is unanswered, help us to find answer for this one

27.

Which of the following is correct to pass $name variable to views?

Answer

Correct Answer: public function index() { return view('welcome')->with('name', 'Foo'); }
public function index() { $name = 'Foo'; return view('welcome', compact('name')); }

Note: This question has more than 1 correct answers

Note: This Question is unanswered, help us to find answer for this one

28.

Which of the following loops are available in blade?

Answer

Correct Answer: @for ($i = 0; $i < 10; $i++) The current value is {{ $i }} @endfor
@foreach ($users as $user)

This is user {{ $user->id }}

@endforeach
@forelse ($users as $user)
  • {{ $user->name }}
  • @empty

    No users

    @endforelse

    @while (true)

    I'm looping forever.

    @endwhile

    Note: This question has more than 1 correct answers

    Note: This Question is unanswered, help us to find answer for this one

    29.

    What will be the output of following in view if $name = "Andy"? Welcome, {{ $name or 'John' }}

    Answer

    Correct Answer: Welcome, Andy

    Note: This Question is unanswered, help us to find answer for this one

    30.

    Which of the following validation rule is correct to validate that the file is an image file having dimensions of min 200 height x min 400 width?

    Answer

    Correct Answer: 'avatar' => 'file:image|dimensions:min_width=100,min_height=200'

    Note: This Question is unanswered, help us to find answer for this one

    31.

    To get a single column from Database table we can chain one of the following method?

    Answer

    Correct Answer: ->pluck('title');

    Note: This Question is unanswered, help us to find answer for this one

    32.

    Which of the following is required before using @section and @endsection in blade file?

    Answer

    Correct Answer: @extends

    Note: This Question is unanswered, help us to find answer for this one

    33.

    To define a callback when view is rendered we can use:

    Answer

    Correct Answer: View::composer()

    Note: This Question is unanswered, help us to find answer for this one

    34.

    To execute the following statement without error, which of the following is correct? $flight = App\User::create(['name' => 'John Doe']);

    Answer

    Correct Answer: In model, set: protected $fillable = ['name'];

    Note: This Question is unanswered, help us to find answer for this one

    35.

    Which of the following can be used in views to print a message if array is empty?

    Answer

    Correct Answer: ul> @forelse ($names as $name) <li>{{ $name }}</li> @empty <li>Don't have names to list.</li> @endforelse </ul>

    Note: This Question is unanswered, help us to find answer for this one

    36.

    Which of the following is correct to loop over an array named $lists in view?

    Answer

    Correct Answer: ul> @foreach ($lists as $list) <li>{{ $list }}</li> @endforeach </ul>

    Note: This Question is unanswered, help us to find answer for this one

    37.

    Which of the following is convenient and correct way to automatically inject the model instances directly into your routes?

    Answer

    Correct Answer: Route::get('users/{user}', function (App\User $user) { return $user->email; });

    Note: This Question is unanswered, help us to find answer for this one

    38.

    Which method can be used to apply common properties to collection of routes?

    Answer

    Correct Answer: group()

    Note: This Question is unanswered, help us to find answer for this one

    39.

    Which of the following artisan command is correct to create a model with table named 'projects'?

    Answer

    Correct Answer: php artisan make:model Project -m

    Note: This Question is unanswered, help us to find answer for this one

    40.

    Which of the following is correct to create a model named 'Person' with accompanying migration?

    Answer

    Correct Answer: php artisan make:model Person -m

    Note: This Question is unanswered, help us to find answer for this one

    41.

    To apply common properties to collection of routes we can use one of the following method?

    Answer

    Correct Answer: Route::group('article/new', 'ArticleController@newArticle');

    Note: This Question is unanswered, help us to find answer for this one

    42.

    How to route when using URL query string?

    Answer

    Correct Answer: //routes.php Route::get('stats', 'StatsController@index'); //StatsController public function index() { if(Input::has('name') and Input::has('device'))) return $this->store(); // Show stat ... } public function store() { $input = Input::only('name', 'device'); // Store stat ... }

    Note: This Question is unanswered, help us to find answer for this one

    43.

    If we have a following URL http://myapp.dev/?foo=bar&baz=boo Which of the following will get the values of 'foo' and 'baz'?

    Answer

    Correct Answer: Request::only(['foo', 'baz']);

    Note: This Question is unanswered, help us to find answer for this one

    44.

    Using Form class to add the 'disabled' attribute for some options.

    Answer

    Correct Answer: {{ Form::select('set', $sets, $prod->set_id, array('class' => 'form-select', 'disabled')) }}

    Note: This Question is unanswered, help us to find answer for this one

    45.

    Add default value to select list in form.

    Answer

    Correct Answer: Form::getselect( 'myselect', array_merge(['' => ['label' => 'Please Select', 'disabled' => true], $categories), $myselectedcategories, array( 'class' => 'form-control', 'id' => 'myselect' ) }}
    Form::getselect( 'myselect', array_merge(['' => ['label' => 'Please Select', 'disabled' => true], $categories), $myselectedcategories, array( 'class' => 'form-control', 'id' => 'myselect' ) }}

    Note: This question has more than 1 correct answers

    Note: This Question is unanswered, help us to find answer for this one

    46.

    Which of the following can be included in route definition to validate form data?

    Answer

    Correct Answer: Validator::make($formData, $rules);

    Note: This Question is unanswered, help us to find answer for this one

    47.

    Which of the following are correct to delete a model with primary key 2?

    Answer

    Correct Answer: $flight = App\Flight::find(2); $flight->delete();

    Note: This Question is unanswered, help us to find answer for this one

    48.

    Which of the following facade can be used to get the current URL for the request?

    Answer

    Correct Answer: URL::current();

    Note: This Question is unanswered, help us to find answer for this one

    49.

    Which of the following is correct to include a section('content') in your template?

    Answer

    Correct Answer: @yield('content')

    Note: This Question is unanswered, help us to find answer for this one

    50.

    Which of the following is correct syntax for passing data to views?

    Answer

    Correct Answer: return view('greetings', ['name' => 'Victoria']);
    return view('greeting')->with('user', 'Victoria');

    Note: This question has more than 1 correct answers

    Note: This Question is unanswered, help us to find answer for this one

    51.

    Which of the following is shortcut for ternary statement in blade?

    Answer

    Correct Answer: {{ $name or 'Default' }}

    Note: This Question is unanswered, help us to find answer for this one

    52.

    The following option will allow you to upload an image with many to many relationships:

    Answer

    Correct Answer: $file = Request::file('resume'); $extension = $file->getClientOriginalExtension(); Storage::disk('local')->put($file->getFilename().'.'.$extension, File::get($file)); $resume = new Resume(); $resume->mime = $file->getClientMimeType(); $resume->filename = $file->getFilename().'.'.$extension; $candidate=new Candidate(); $data=array_except($data, array('_token','resume')); $user->candidate()->save($candidate); $candidate->resume()->save($resume); $candidate=$user->candidate($user); $candidate->update($data);

    Note: This Question is unanswered, help us to find answer for this one

    53.

    Which of the following is correct directory for view files?

    Answer

    Correct Answer: resources/views

    Note: This Question is unanswered, help us to find answer for this one

    54.

    Which of the following is executed first?

    Answer

    Correct Answer: View::creator('profile', 'App\Http\ViewCreators\ProfileCreator');

    Note: This Question is unanswered, help us to find answer for this one

    55.

    Which of the following is correct for blade template?

    Answer

    Correct Answer:

    {{ date('d/m/y') }}


    @for ($i = 0; $i < 999; $i++)

    Even {{ $i }} red pandas, aren't enough!

    @endfor

    Note: This question has more than 1 correct answers

    Note: This Question is unanswered, help us to find answer for this one

    56.

    To reference a view view('user.profile', $data); Which of the following is correct name and path for view file?

    Answer

    Correct Answer: resources/views/user/profile.blade.php

    Note: This Question is unanswered, help us to find answer for this one

    57.

    Suppose we have a collection which contains the website news. What is the best way to share that collection in all views?

    Answer

    Correct Answer: view()->share('news', NewsStory::orderBy('created_at', 'desc')->paginate(5));

    Note: This Question is unanswered, help us to find answer for this one

    58.

    Which one of the following is the last parameter for @each directive in blade?

    Answer

    Correct Answer: The view that will be rendered if the given array is empty

    Note: This Question is unanswered, help us to find answer for this one

    59.

    Which of the following is correct to render the expression using javascript instead of blade?

    Answer

    Correct Answer: Hello, @{{ name }}.

    Note: This Question is unanswered, help us to find answer for this one

    60.

    Which of the following will list all routes?

    Answer

    Correct Answer: php artisan route

    Note: This Question is unanswered, help us to find answer for this one

    61.

    Which of the following is true to get the URL of an image 'img/logo.png' from route '/example' ?

    Answer

    Correct Answer: Route::get('example', function () { return URL::asset('img/logo.png'); });

    Note: This Question is unanswered, help us to find answer for this one

    62.

    Route parameters should not have underscore '_' character?

    Answer

    Correct Answer: False

    Note: This Question is unanswered, help us to find answer for this one

    63.

    Which of the following is correct to get the URL of named route 'contact'?

    Answer

    Correct Answer: $url = route('contact');

    Note: This Question is unanswered, help us to find answer for this one

    64.

    Which of the following are correct route methods?

    Answer

    Correct Answer: Route::get($uri, $callback);
    Route::options($uri, $callback);
    Route::put($uri, $callback);
    Route::delete($uri, $callback);

    Note: This question has more than 1 correct answers

    Note: This Question is unanswered, help us to find answer for this one

    65.

    Which of the following code is correct to insert multiple records?

    Answer

    Correct Answer: public function store(Request $request) { $inputArrays = Input::all(); $schedule = new Schedule; foreach ($inputArrays as $array) { $student->name = $name; $student->for_date = $date; $student->save(); } return view('students.index'); }

    Note: This Question is unanswered, help us to find answer for this one

    66.

    Which of the following is correct to retrieve all comments which are associated with single Post (post_id = 1) with one to many relation in Model?

    Answer

    Correct Answer: $comments = App\Post::find(1)->comments;

    Note: This Question is unanswered, help us to find answer for this one

    67.

    Get only selected column from database table.

    Answer

    Correct Answer: $selected_vote = users_details::get(['selected_vote']);

    Note: This Question is unanswered, help us to find answer for this one

    68.

    Which of the following databases are supported by Laravel 5?

    Answer

    Correct Answer: PostgreSQL
    MySQL
    SQLite

    Note: This question has more than 1 correct answers

    Note: This Question is unanswered, help us to find answer for this one

    69.

    Which of the following is correct to retrieve soft deleted models?

    Answer

    Correct Answer: $flights = App\Flight::onlyTrashed()->get();

    Note: This Question is unanswered, help us to find answer for this one

    70.

    Which of the following is correct to get all rows from the table named users?

    Answer

    Correct Answer: DB::table('users')->get();

    Note: This Question is unanswered, help us to find answer for this one

    71.

    Creating database view in migration laravel 5.2

    Answer

    Correct Answer: CREATE VIEW wones AS SELECT (name from leagues) AS name join teams where (leagues.id = team.country_id) join players where (teams.id = players.team_id) join points where (players.id = points.player_id) sum(points.remnants) AS trem count(points.remnants where points.remnants < 4) AS crem
    CREATE VIEW wones AS SELECT leagues.name, sum(points.remnants) AS trem sum(IF(points.remnants<4, 1, 0)) AS crem FROM leagues JOIN teams ON (leagues.id = team.country_id) JOIN players ON (teams.id = players.team_id) JOIN points ON (players.id = points.player_id);

    Note: This question has more than 1 correct answers

    Note: This Question is unanswered, help us to find answer for this one

    72.

    All eloquent models protect against mass-assignment by default.

    Answer

    Correct Answer: True

    Note: This Question is unanswered, help us to find answer for this one

    73.

    Eloquent can fire the following events allowing you to hook into various points in the model's lifecycle. (choose all that apply)

    Answer

    Correct Answer: creating
    created
    updating
    restoring

    Note: This question has more than 1 correct answers

    Note: This Question is unanswered, help us to find answer for this one

    74.

    To retrieve all blog posts that have at least one comment. (Model has one to many relation already set up)

    Answer

    Correct Answer: $posts = App\Post::has('comments')->get();

    Note: This Question is unanswered, help us to find answer for this one

    75.

    The migrations directory contains PHP classes which allow Laravel to update the Schema of your current __, or populate it with values while keeping all versions of the application in sync. Migration files must not be created manually, as their file name contains a timestamp. Instead usetheArtisanCLIinterfacecommand php artisan migrate:make to create a new Migration.

    Answer

    Correct Answer: database

    Note: This Question is unanswered, help us to find answer for this one

    76.

    Which method will retrieve the first result of the query in Laravel eloquent?

    Answer

    Correct Answer: findOrFail(1);

    Note: This Question is unanswered, help us to find answer for this one

    77.

    Which of the following command should be used to run all outstanding migration?

    Answer

    Correct Answer: php artisan migrate

    Note: This Question is unanswered, help us to find answer for this one

    78.

    Which of the following methods are provided by migration class?

    Answer

    Correct Answer: up()
    down()

    Note: This question has more than 1 correct answers

    Note: This Question is unanswered, help us to find answer for this one

    79.

    If you don't want Eloquent to automatically manage created_at and updated_at columns, which of the following will be correct?

    Answer

    Correct Answer: Set the model $timestamps property to false

    Note: This Question is unanswered, help us to find answer for this one

    80.

    Which of the following file contains the database configurations?

    Answer

    Correct Answer: config/database.php

    Note: This Question is unanswered, help us to find answer for this one

    81.

    Which of the following is a correct way to assign middleware 'auth' to a route?

    Answer

    Correct Answer: Route::get('profile', [ 'middleware' => 'auth', 'uses' => 'UserController@show' ]);

    Note: This Question is unanswered, help us to find answer for this one

    82.

    To share route attributes, it is best to use route groups?

    Answer

    Correct Answer: True

    Note: This Question is unanswered, help us to find answer for this one

    83.

    How to get Header Authorization key in controller?

    Answer

    Correct Answer: public function yourControllerFunction(\Illuminate\Http\Request $request) { $header = $request->header('Authorization'); // do some stuff }

    Note: This Question is unanswered, help us to find answer for this one

    84.

    Which of the following are correct for route definitions?

    Answer

    Correct Answer: Route::get('user/{name?}')
    Route::get('user/{name}')

    Note: This question has more than 1 correct answers

    Note: This Question is unanswered, help us to find answer for this one

    85.

    \Config::set('database.connections.customers.database', 'db_A'); 

    Answer

    Correct Answer: All of the above

    Note: This Question is unanswered, help us to find answer for this one

    86.

    Which method can be used to store items in cache permanently?

    Answer

    Correct Answer: Cache::forever('key', 'value');

    Note: This Question is unanswered, help us to find answer for this one

    87.

    List out few different return types of a controller action method?

    Answer

    Correct Answer: All of the above

    Note: This Question is unanswered, help us to find answer for this one

    88.

    Which view facade within a service provider's boot method can be used to share data with all views?

    Answer

    Correct Answer: View::share('key', 'value');

    Note: This Question is unanswered, help us to find answer for this one

    89.

    Which of the following controller should be extended by all controllers?

    Answer

    Correct Answer: Base Controller

    Note: This Question is unanswered, help us to find answer for this one

    90.

    Which of the following variable is available inside your loops in blade?

    Answer

    Correct Answer: $loop

    Note: This Question is unanswered, help us to find answer for this one

    91.

    If blog post has infinite number of comments we can define one-to-many relationship by placing following code in post model?

    Answer

    Correct Answer: public function comments() { return $this->hasMany('App\Comment'); }

    Note: This Question is unanswered, help us to find answer for this one

    92.

    To create a controller which handles all "CRUD" routes, which of the following is correct command?

    Answer

    Correct Answer: php artisan make:controller CarController –resource

    Note: This Question is unanswered, help us to find answer for this one

    93.

    Which of the following can be used to create a controller with typical "CRUD" routes?

    Answer

    Correct Answer: php artisan make:controller YourController –resource

    Note: This Question is unanswered, help us to find answer for this one

    94.

    Which of the following methods can be used with models to build relationships?

    Answer

    Correct Answer: belongsToMany()
    hasOne()
    hasMany()
    belongsTo()

    Note: This question has more than 1 correct answers

    Note: This Question is unanswered, help us to find answer for this one

    95.

    Use a validation rules inside the custom validation class?

    Answer

    Correct Answer: $emailsInput = Input::get('email'); $emails = explode(',', $emails); foreach($emails as $email) { $validator = Validator::make( ['email' => $email], ['email' => 'required|email'] ); if ($validator->fails()) { // There is an invalid email in the input

    Note: This Question is unanswered, help us to find answer for this one

    96.

    Which of the following is/are correct to define custom validation messages?

    Answer

    Correct Answer: Pass the custom messages as the third argument to the Validator::make method
    Specify your custom messages in a language file.
    Customize the error messages used by the form request by overriding the messages method

    Note: This question has more than 1 correct answers

    Note: This Question is unanswered, help us to find answer for this one

    97.

    Which of the following is correct to define middleware for multiple views in controller file?

    Answer

    Correct Answer: public function __construct() { $this->middleware('admin', ['only' => ['create', 'edit', 'show']]); }

    Note: This Question is unanswered, help us to find answer for this one

    98.

    How the Laravel controller method get the parameters?

    Answer

    Correct Answer: public function store(Request $request, $foo = 'bar'){ { $this->validate($request, [ 'title' => 'required|unique|max:255', 'body' => 'required', ]); }

    Note: This Question is unanswered, help us to find answer for this one

    99.

    Which of the following methods can be used to register a route that responds to all HTTP verbs?

    Answer

    Correct Answer: Route::any()

    Note: This Question is unanswered, help us to find answer for this one

    100.

    Which of the following is correct to create a route(s) to resource controller named "PostController"?

    Answer

    Correct Answer: Route::resource('post', 'PostController');

    Note: This Question is unanswered, help us to find answer for this one

    101.

    Which of the following is correct to have an optional parameter in route?

    Answer

    Correct Answer: Route::get('user/{name?}', function ($name = null) { return $name; });

    Note: This Question is unanswered, help us to find answer for this one

    102.

    Which method can be used to create custom blade directives?

    Answer

    Correct Answer: Blade::directive()

    Note: This Question is unanswered, help us to find answer for this one

    103.

    Which of the following is the correct way to set SQLite as database for unit testing?

    Answer

    Correct Answer: 'sqlite' => [ 'driver' => 'sqlite', 'database' => storage_path('database.sqlite'), 'prefix' => '', ],

    Note: This Question is unanswered, help us to find answer for this one

    104.

    Which of the following validation rules are acceptable?

    Answer

    Correct Answer: ['field' => 'accepted']
    ['field' => 'active_url']
    ['field' => 'after:10/10/16']
    ['field' => 'alpha']

    Note: This question has more than 1 correct answers

    Note: This Question is unanswered, help us to find answer for this one

    105.

    If you need to add additional routes to a resource controller beyond the default set of resource routes, you should define those routes after your call to Route::resource

    Answer

    Correct Answer: False

    Note: This Question is unanswered, help us to find answer for this one

    106.

    _____ directory contains much of the custom code used to power your application, including the models, controllers and middleware.

    Answer

    Correct Answer: app

    Note: This Question is unanswered, help us to find answer for this one

    107.

    How do you define a single action controller for the following route?

    Route::get('user/{id}', 'ShowProfile');

    Answer

    Correct Answer: You may place a single __invoke method on the controller

    Note: This Question is unanswered, help us to find answer for this one

    108.

    The field under validation must be present in the input data and not empty. A field is considered "empty" if one of the following conditions are true:

    Answer

    Correct Answer: All of the above

    Note: This Question is unanswered, help us to find answer for this one

    109.

    How access custom textbox name in Laravel using validation 'unique'?

    Answer

    Correct Answer: 'admin_username' => 'required|min:5|max:15|unique:administrators,username',

    Note: This Question is unanswered, help us to find answer for this one

    110.

    How to use laravel routing for unknown number of parameters in URL.

    Answer

    Correct Answer: //in routes.php Route::get('/{book?}/{chapter?}/{topic?}/{article?}', 'controller@func'); //in your controller public function func($book = null, $chapter = null, $topic = null, $article = null) { ... }

    Note: This Question is unanswered, help us to find answer for this one

    111.

    ___ web applications respond to meaningful HTTP verbs with appropriate data.

    Answer

    Correct Answer: RESTful

    Note: This Question is unanswered, help us to find answer for this one

    112.

    ____ are an important part of any web-based application. They help control the flow of the application which allows us to receive input from our users and make decisions that affect the functionality of our applications.

    Answer

    Correct Answer: Forms

    Note: This Question is unanswered, help us to find answer for this one

    113.

    Validation If checkbox ticked then Input text is required?

    Answer

    Correct Answer: return [ 'has_login' => 'sometimes', 'pin' => 'required_with:has_login,on', ];
    return [ 'has_login' => 'sometimes', 'pin' => 'required_if:has_login,on', ];

    Note: This question has more than 1 correct answers

    Note: This Question is unanswered, help us to find answer for this one

    114.

    To protect application from cross-site request forgery attacks, which of the following should be included in forms?

    Answer

    Correct Answer: {{ csrf_field() }}

    Note: This Question is unanswered, help us to find answer for this one

    115.

    To validate a date named finish_date against following rules: -Should be date -Required -Should be greater than start_date which of the following is correct validation rule?

    Answer

    Correct Answer: 'finish_date' => 'required|date|after:start_date'

    Note: This Question is unanswered, help us to find answer for this one