wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Untitled Quiz

Total questions: 45

Worksheet time: 23mins

Name
Class
Date
1.

Trong Laravel, Route dùng để làm gì?

a)

Quản lý database

b)

Định tuyến URL đến controller

c)

Hiển thị giao diện

d)

Migrate dữ liệu

2.

Lệnh nào tạo route resource cho API?

a)

Route::resource

b)

Route::apiResource

c)

Route::get

d)

Route::post

3.

Route::apiResource('books', BookController::class) tạo bao nhiêu method?

a)

7

b)

5

c)

3

d)

6

4.

Trong MVC của Laravel, View chịu trách nhiệm:

a)

Xử lý business logic

b)

Hiển thị dữ liệu cho người dùng

c)

Quản lý database

d)

Định tuyến request

5.

Blade template dùng cú pháp nào để in ra biến?

a)

{{ variable }}

b)

<% variable %>

c)

[[ variable ]]

d)

(( variable ))

6.

Lệnh tạo Controller?

a)

php artisan make:model

b)

php artisan controller:create

c)

php artisan make:controller

d)

php artisan new:controller

7.

Trong Laravel, file route API đặt ở đâu?

a)

routes/web.php

b)

routes/api.php

c)

config/routes.php

d)

app/routes/api.php

8.

Lệnh tạo migration?

a)

php artisan migrate:create

b)

php artisan make:migration

c)

php artisan migration:new

d)

php artisan db:migrate

9.

Lệnh chạy migration?

a)

php artisan migrate

b)

php artisan db:run

c)

php artisan migrate:push

d)

php artisan schema:run

10.

Model Eloquent thường nằm ở thư mục nào?

a)

app/Database

b)

app/Models

c)

app/Http/Models

d)

database/models

11.

Book::all() trả về kiểu dữ liệu gì?

a)

JSON

b)

Array thuần

c)

Eloquent Collection

d)

SQL Result

12.

Phương thức dùng để lấy 1 bản ghi theo id?

a)

find()

b)

first()

c)

get()

d)

where() only

13.

Migration dùng để làm gì?

a)

Chỉnh sửa Blade

b)

Định nghĩa cấu trúc DB bằng mã lệnh

c)

Tạo controller

d)

Xử lý logic trong app

14.

Muốn tạo mới record trong Eloquent ta dùng:

a)

Book::add()

b)

Book::insert()

c)

Book::create()

d)

Book::push()

15.

Middleware dùng để làm gì?

a)

Render Blade

b)

Lọc request trước khi vào controller

c)

Lưu vào database

d)

Chạy migration

16.

Lệnh tạo middleware?

a)

php artisan make:middleware

b)

php artisan middleware:new

c)

php artisan create:middleware

d)

php artisan route:middleware

17.

Middleware kiểm tra login tên là gì trong mặc định Laravel?

a)

isLogged

b)

auth

c)

verified

d)

loginCheck

18.

Lệnh cài Laravel Breeze?

a)

composer require laravel/breeze

b)

composer install breeze

c)

php artisan make:auth

d)

php artisan auth:install

19.

Sau khi cài Breeze cần chạy lệnh nào để build frontend?

a)

npm run production

b)

npm run dev

c)

node build

d)

build:frontend

20.

Breeze cung cấp những gì?

a)

Mỗi user role

b)

UI đăng ký, đăng nhập

c)

API CRUD

d)

Tự động deploy

21.

Để tạo bảng users từ Breeze cần chạy:

a)

php artisan migrate

b)

php artisan breeze:migrate

c)

php artisan db:users

d)

php artisan table:users

22.

Aiven dùng để làm gì?

a)

Lưu trữ file

b)

Cung cấp cloud database

c)

Tạo Blade template

d)

Deploy Laravel

23.

Gói Laravel tích hợp Aiven là:

a)

aiven/laravel-database

b)

aiven/aiven-laravel

c)

laravel/aiven

d)

cloud/aiven-db

24.

Lệnh kiểm tra các service của Aiven:

a)

php artisan aiven:check

b)

php artisan aiven:list

c)

php artisan aiven:service

d)

php artisan aiven:get

25.

Lệnh nhận cấu hình DB từ Aiven:

a)

php artisan aiven:connect

b)

php artisan aiven:getconfig

c)

php artisan aiven:database

d)

php artisan aiven:env

26.

Biến môi trường bắt buộc khi dùng Aiven:

a)

DB_MODE

b)

AIVEN_API_TOKEN

c)

AIVEN_KEY

d)

CLOUD_SQL

27.

DB_URL trong môi trường Aiven chứa gì?

a)

địa chỉ Vite

b)

SSH key

c)

Connection string MySQL

d)

Laravel cache

28.

.sslrootcert trong .env dùng để:

a)

Xác thực mã OTP

b)

Kết nối HTTPS

c)

Xác thực chứng chỉ kết nối database

d)

Render HTML

29.

Vite được sử dụng để:

a)

Chạy migration

b)

Build frontend assets (JS, CSS)

c)

Tạo DB cloud

d)

Render Blade

30.

Khi deploy trên Codespace, cần cấu hình lại gì?

a)

Route::prefix

b)

vite.config.js server.hmr

c)

Migration

d)

Model

31.

Biến môi trường trong Codespace lưu hostname là:

a)

CODESPACE_NAME

b)

GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN

c)

VITE_DEV_SERVER_HOST

d)

HOSTNAME

32.

APP_URL dùng để:

a)

Build CSS

b)

Chỉ định domain cho ứng dụng

c)

Lưu tên người dùng

d)

Khai báo Controller

33.

Muốn lấy danh sách book qua API:

a)

GET /books

b)

POST /books

c)

GET /book-list

d)

POST /book/index

34.

Tạo mới book dùng HTTP method nào?

a)

GET

b)

POST

c)

PUT

d)

DELETE

35.

Update book dùng method:

a)

POST

b)

PATCH / PUT

c)

DELETE

d)

OPTIONS

36.

Xóa book dùng method:

a)

POST

b)

GET

c)

DELETE

d)

HEAD

37.

Laravel project mới tạo bằng:

a)

laravel new

b)

composer create-project

c)

php artisan new

d)

composer make:laravel

38.

File .env dùng để:

a)

Luu code PHP

b)

Luu thông tin cấu hình môi trường

c)

Luu giao diện

d)

Luu lịch sử request

39.

Muốn web xử lý HTTPS từ Codespace, cần cấu hình middleware:

a)

handleProxy

b)

trustProxies

c)

routeMiddleware

d)

staticProxies

40.

Public link dùng để:

a)

Chạy lệnh composer

b)

Tạo URL công khai cho tệp trong storage

c)

Debug route

d)

Build vite

41.

php artisan aiven:state --service mysql-xxxxx dùng để:

a)

Kiểm tra migration

b)

Kiểm tra trạng thái service Aiven

c)

Reset database

d)

Sinh API token

42.

Khi chạy Breeze nhưng web không load CSS, nguyên nhân phổ biến nhất?

a)

Sai route

b)

Vite không chạy

c)

Database lỗi

d)

User chưa đăng nhập

43.

Để gán trust proxy '*' trong local cần sửa file:

a)

public/index.php

b)

bootstrap/app.php

c)

config/app.php

d)

server.php

44.

Trong Route của Codespace, vì sao không dùng localhost?

a)

Vì Laravel không hỗ trợ localhost

b)

Vì Codespace dùng domain *.app.github.dev

c)

Vì CORS

d)

Vì nginx lỗi

45.

Khi gọi API /book nhưng bị 404, khả năng cao nhất:

a)

Chưa migrate

b)

Chưa khai báo route trong api.php

c)

Chưa build vite

d)

Chưa connect DB