NEW
Font size
WorksheetsSurFrieess HAHAHAHA
Total questions: 30
Worksheet time: 15mins
What command is used to create a new Laravel project?
php artisan new project-name
npm create laravel project-name
laravel new project-name
composer make project-name
Which command starts the Laravel development server?
npm run dev
php artisan run
php artisan start
php artisan serve
In the .env file, which variable defines the database name?
DATABASE_NAME
DB_SCHEMA
DB_NAME
DB_DATABASE
What is the default database host for local development?
192.168.1.1
Both localhost and 127.0.0.1
localhost
127.0.0.1
Which command creates a new migration file?
php artisan migration:create students
php artisan create:migration students
php artisan new:migration students
php artisan make:migration create_students_table
What command runs all pending migrations?
php artisan migrate
php artisan db:migrate
php artisan migrate:run
php artisan migration:execute
In the students migration, which method creates an auto-incrementing ID?
$table->autoIncrement()
$table->bigIncrements('id')
Both $table->id() and $table->bigIncrements('id')
$table->primaryKey()
Which method makes an email field unique in a migration?
$table->string('email', unique: true)
$table->unique('email')
$table->string('email')->distinct()
$table->string('email')->unique()
What does $table->timestamps() add to a table?
deleted_at
created_at only
updated_at only
created_at and updated_at
What command creates a new controller?
php artisan controller:make StudentController
php artisan new:controller StudentController
php artisan create:controller StudentController
php artisan make:controller StudentController
What file defines web routes in Laravel?
routes/api.php
routes/web.php
app/routes.php
config/routes.php
What is the correct route definition for displaying the dashboard?
Route('/dashboard', [StudentController, 'index'])
get('/dashboard', StudentController::index)
Route::get('/dashboard', [StudentController::class, 'index'])
Route->get('/dashboard', 'StudentController@index')
Which HTTP method should be used for creating a new student?
PATCH
PUT
GET
POST
What Blade directive displays a variable's value?
{{ $variable }}
@echo($variable)
<%= $variable %>
@print($variable)
Which Blade directive must be included in all POST forms?
@security
@protection
@token
@csrf
What Blade directive loops through an array of students?
@foreach($students as $student)
@for($students as $student)
@each($students as $student)
@loop($students as $student)
How do you end a @foreach loop in Blade?
@close
@endloop
@end
@endforeach
What does session('success') do in the dashboard view?
Saves data to the session
Creates a new session
Deletes the session
Retrieves a flash message from the session
What does @if(session('success')) check for?
If the database connection is successful
If a 'success' message exists in the session
If session exists
If the user is logged in
In the form, what does old('name') do?
Gets data from the database
Gets the oldest record
Validates the input
Retrieves the previously submitted value
what does the command "git add ." do?
What does @error('name') display?
System errors
Database errors
All errors
Validation error for the 'name' field
What does $loop->iteration display in a @foreach loop?
The remaining items
The array index
The total count
The current iteration number (starting from 1)
What happens when you click the Delete button in your form?
Direct DELETE request
GET request is sent
PUT request
POST request with DELETE method spoofing
What does route('students.store') generate?
The HTTP method
The URL for the named route
The view name
The controller name
In Tailwind, what does 'rounded-lg' do?
Makes the element round
Adds large padding
Makes text large
Adds large border radius
What does 'dark:bg-neutral-800' do in Tailwind?
Creates a shadow
Applies background color only in dark mode
Changes text color
Always uses dark background
What does DB_CONNECTION=mysql specify in the .env file?
The connection status
The database version
The database server software
The database driver Laravel should use
what does composer install do?
What is Tailwind FluxUI?
