Udemy Laravel 11 From Basics To Advance 2024 Better -
Course Overview: Udemy – Laravel 11 from Basics to Advance (2024 Edition)
In the rapidly evolving landscape of PHP web development, staying current is non-negotiable. Laravel 11, released in early 2024, introduced a leaner application skeleton, fewer configuration files, and a more streamlined development experience. The Udemy course "Laravel 11 from Basics to Advance" (2024 Edition) has been specifically updated to harness these changes, positioning itself as a "better" pathway from novice to professional.
Section 10: RESTful API Development with Laravel 11 (2 hours)
- 10.1: API vs Web Routes. Setting
api.php. - 10.2: API Resources (
php artisan make:resource). - 10.3: Return JSON responses with correct HTTP status codes.
- 10.4: API Authentication using Laravel Sanctum (API Tokens).
- 10.5: Protecting API endpoints (
auth:sanctummiddleware). - 10.6: Rate Limiting (Prevent abuse).
- 10.7: Testing API with Postman.
- 10.8: Versioning APIs (v1, v2).
Guide: "Udemy — Laravel 11 From Basics to Advance (2024) — Better" (complete review & study plan)
Phase 1: Database & Models
We will start with the database structure. We need Courses, Sections (modules), and Lectures (videos). udemy laravel 11 from basics to advance 2024 better
1. Create Models and Migrations Run the following command: Course Overview: Udemy – Laravel 11 from Basics
php artisan make:model Course -m
php artisan make:model Section -m
php artisan make:model Lecture -m
2. Define the Schema
Edit the migration files in database/migrations. Guide: "Udemy — Laravel 11 From Basics to
// ..._create_courses_table.php
Schema::create('courses', function (Blueprint $table)
$table->id();
$table->foreignId('user_id')->constrained()->onDelete('cascade'); // Instructor
$table->string('title');
$table->string('slug')->unique();
$table->text('description');
$table->decimal('price', 8, 2)->default(0.00);
$table->string('thumbnail')->nullable();
$table->enum('status', ['draft', 'published'])->default('draft');
$table->timestamps();
);
// ..._create_sections_table.php
Schema::create('sections', function (Blueprint $table)
$table->id();
$table->foreignId('course_id')->constrained()->onDelete('cascade');
$table->string('title');
$table->integer('order')->default(0);
$table->timestamps();
);
// ..._create_lectures_table.php
Schema::create('lectures', function (Blueprint $table)
$table->id();
$table->foreignId('section_id')->constrained()->onDelete('cascade');
$table->string('title');
$table->string('video_path')->nullable(); // URL or local path
$table->text('content')->nullable(); // Text content
$table->integer('duration_seconds')->default(0);
$table->boolean('is_preview')->default(false);
$table->integer('order')->default(0);
$table->timestamps();
);
3. Define Relationships (Models) Use Laravel 11's streamlined casting and strict typing.
// app/Models/Course.php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Course extends Model
protected $fillable = [
'user_id', 'title', 'slug', 'description', 'price', 'thumbnail', 'status'
];
protected function casts(): array
return [
'price' => 'decimal:2',
];
public function instructor(): BelongsTo
return $this->belongsTo(User::class, 'user_id');
public function sections(): HasMany
return $this->hasMany(Section::class)->orderBy('order');
// app/Models/Section.php
namespace App\Models;
// ... imports
class Section extends Model
protected $fillable = ['course_id', 'title', 'order'];
public function lectures(): HasMany
return $this->hasMany(Lecture::class)->orderBy('order');
// app/Models/Lecture.php
namespace App\Models;
// ... imports
class Lecture extends Model
protected $fillable = [
'section_id', 'title', 'video_path', 'content', 'duration_seconds', 'is_preview', 'order'
];
protected function casts(): array
return [
'is_preview' => 'boolean',
];
What You’ll Be Able to Build After This Course
- RESTful APIs with token-based authentication
- Multi-role dashboards (admin, editor, user)
- Real-time notifications using Laravel Reverb (included in v11)
- Scheduled tasks (task scheduler without cron on shared hosting)
- Deployed Laravel apps on DigitalOcean, AWS, or shared cPanel hosting
Section 6: Authentication & Authorization (The Right Way) (2.5 hours)
- 6.1: Laravel 11’s NEW Starter Kits (Breeze vs Jetstream).
- 6.2: Installing Laravel Breeze (Blade + Tailwind).
- 6.3: How Breeze Works: Login, Register, Password Reset.
- 6.4: Manually adding a "Roles" table (Admin vs User).
- 6.5: Gates & Policies (Who can edit a post?).
- 6.6: Using
@can,@cannotin Blade. - 6.7: Email Verification setup (Mailtrap).
- 6.8: Protecting Routes with Middleware (
auth,verified,admin).