wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

SurFrieess HAHAHAHA

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

What command is used to create a new Laravel project?

a)

php artisan new project-name

b)

npm create laravel project-name

c)

laravel new project-name

d)

composer make project-name

2.

Which command starts the Laravel development server?

a)

npm run dev

b)

php artisan run

c)

php artisan start

d)

php artisan serve

3.

In the .env file, which variable defines the database name?

a)

DATABASE_NAME

b)

DB_SCHEMA

c)

DB_NAME

d)

DB_DATABASE

4.

What is the default database host for local development?

a)

192.168.1.1

b)

Both localhost and 127.0.0.1

c)

localhost

d)

127.0.0.1

5.

Which command creates a new migration file?

a)

php artisan migration:create students

b)

php artisan create:migration students

c)

php artisan new:migration students

d)

php artisan make:migration create_students_table

6.

What command runs all pending migrations?

a)

php artisan migrate

b)

php artisan db:migrate

c)

php artisan migrate:run

d)

php artisan migration:execute

7.

In the students migration, which method creates an auto-incrementing ID?

a)

$table->autoIncrement()

b)

$table->bigIncrements('id')

c)

Both $table->id() and $table->bigIncrements('id')

d)

$table->primaryKey()

8.

Which method makes an email field unique in a migration?

a)

$table->string('email', unique: true)

b)

$table->unique('email')

c)

$table->string('email')->distinct()

d)

$table->string('email')->unique()

9.

What does $table->timestamps() add to a table?

a)

deleted_at

b)

created_at only

c)

updated_at only

d)

created_at and updated_at

10.

What command creates a new controller?

a)

php artisan controller:make StudentController

b)

php artisan new:controller StudentController

c)

php artisan create:controller StudentController

d)

php artisan make:controller StudentController

11.

What file defines web routes in Laravel?

a)

routes/api.php

b)

routes/web.php

c)

app/routes.php

d)

config/routes.php

12.

What is the correct route definition for displaying the dashboard?

a)

Route('/dashboard', [StudentController, 'index'])

b)

get('/dashboard', StudentController::index)

c)

Route::get('/dashboard', [StudentController::class, 'index'])

d)

Route->get('/dashboard', 'StudentController@index')

13.

Which HTTP method should be used for creating a new student?

a)

PATCH

b)

PUT

c)

GET

d)

POST

14.

What Blade directive displays a variable's value?

a)

{{ $variable }}

b)

@echo($variable)

c)

<%= $variable %>

d)

@print($variable)

15.

Which Blade directive must be included in all POST forms?

a)

@security

b)

@protection

c)

@token

d)

@csrf

16.

What Blade directive loops through an array of students?

a)

@foreach($students as $student)

b)

@for($students as $student)

c)

@each($students as $student)

d)

@loop($students as $student)

17.

How do you end a @foreach loop in Blade?

a)

@close

b)

@endloop

c)

@end

d)

@endforeach

18.

What does session('success') do in the dashboard view?

a)

Saves data to the session

b)

Creates a new session

c)

Deletes the session

d)

Retrieves a flash message from the session

19.

What does @if(session('success')) check for?

a)

If the database connection is successful

b)

If a 'success' message exists in the session

c)

If session exists

d)

If the user is logged in

20.

In the form, what does old('name') do?

a)

Gets data from the database

b)

Gets the oldest record

c)

Validates the input

d)

Retrieves the previously submitted value

21.

what does the command "git add ." do?

a)
Commits all changes in the current directory immediately.
b)
Removes all files from the staging area.
c)
Displays the status of the current repository.
d)
Stages all changes in the current directory and subdirectories for the next commit.
22.

What does @error('name') display?

a)

System errors

b)

Database errors

c)

All errors

d)

Validation error for the 'name' field

23.

What does $loop->iteration display in a @foreach loop?

a)

The remaining items

b)

The array index

c)

The total count

d)

The current iteration number (starting from 1)

24.

What happens when you click the Delete button in your form?

a)

Direct DELETE request

b)

GET request is sent

c)

PUT request

d)

POST request with DELETE method spoofing

25.

What does route('students.store') generate?

a)

The HTTP method

b)

The URL for the named route

c)

The view name

d)

The controller name

26.

In Tailwind, what does 'rounded-lg' do?

a)

Makes the element round

b)

Adds large padding

c)

Makes text large

d)

Adds large border radius

27.

What does 'dark:bg-neutral-800' do in Tailwind?

a)

Creates a shadow

b)

Applies background color only in dark mode

c)

Changes text color

d)

Always uses dark background

28.

What does DB_CONNECTION=mysql specify in the .env file?

a)

The connection status

b)

The database version

c)

The database server software

d)

The database driver Laravel should use

29.

what does composer install do?

a)
It updates the project dependencies in 'composer.lock'.
b)
It installs the project dependencies defined in 'composer.json'.
c)
It removes unused dependencies from the project.
d)
It creates a new 'composer.json' file for the project.
30.

What is Tailwind FluxUI?

a)
Tailwind FluxUI is a plugin for enhancing Tailwind CSS with animations.
b)
Tailwind FluxUI is a CSS preprocessor for styling websites.
c)
Tailwind FluxUI is a JavaScript framework for building web applications.
d)
Tailwind FluxUI is a design system and component library for Tailwind CSS.