Skip to content

Laravel Framework Practice Exam

Test yourself under real exam conditions: 50 timed questions, 60 on the clock, pass mark 70%%. Instant score with a full review of everything you got wrong. Free — no account needed.

📝 50 questions · ⏱ 60 minutes · 🎯 Pass mark 70% · 🆓 Free, no signup

Exam details

  • 50 questions drawn from 170 cards
  • Countdown timer — auto-submits when time runs out
  • Pass mark 70% (real certification threshold)
  • Full review of wrong answers at the end
  • No signup required — save your score with a free account

Sample Questions

5 shown

What is Laravel Eloquent ORM?

Show ▼

Eloquent is Laravel's built-in Active Record ORM. Each database table has a corresponding Model class used to interact with that table. It provides an expressive syntax for queries:
$users = User::where('active', true)->get();

How do you define a one-to-many relationship in Eloquent?

Show ▼

In the parent model, define a method returning hasMany():
public function posts() { return $this->hasMany(Post::class); }
In the child model, define the inverse with belongsTo():
public function user() { return $this->belongsTo(User::class); }

What is eager loading in Eloquent and why is it important?

Show ▼

Eager loading solves the N+1 query problem by loading relationships upfront:
$books = Book::with('author')->get();
Without it, accessing a relationship in a loop triggers a separate query per iteration, causing performance issues.

How do you create a new Eloquent model and migration together?

Show ▼

Use the Artisan command:
php artisan make:model Post -m
The -m flag generates a migration file alongside the model. You can also add -f for a factory and -s for a seeder.

What are Eloquent accessors and mutators?

Show ▼

Accessors transform attribute values when reading:
protected function firstName(): Attribute { return Attribute::make(get: fn($value) => ucfirst($value)); }
Mutators transform values when setting:
set: fn($value) => strtolower($value)

🎯 Take the Laravel Framework Practice Exam