📚

Laravel Bootcamp: Comprehensive Overview

Aug 6, 2024

Day 1 - Introduction

  • Overview of Laravel: A PHP framework designed for web applications, known for its elegant syntax.
  • Key Features: MVC architecture, Eloquent ORM, security features, and built-in tools for routing, sessions, and authentication.

Day 2 - Setting Up Laravel

  • Installation: Use Composer to create a new Laravel project (composer create-project --prefer-dist laravel/laravel projectName).
  • Directory Structure: Familiarize with key directories like app, config, database, public, resources, routes, and storage.
  • Running the Application: Use php artisan serve to start a local development server.

Day 3 - Routing Basics

  • Defining Routes: Use the routes/web.php file to define your application routes. Basic syntax: Route::get('/url', 'Controller@method');
  • Route Parameters: Capture dynamic segments in URLs (e.g., /user/{id}).
  • Route Groups: Use route groups for shared attributes (e.g., middleware).

Day 4 - Controllers

  • Creating Controllers: Use php artisan make:controller ControllerName.
  • Resource Controllers: Generate resourceful routes and actions using Route::resource('resource', 'ResourceController');.
  • Returning Views: Return views from controller methods using return view('viewName');.

Day 5 - Blade Templating

  • Blade Syntax: Use {{ }} for PHP expressions, @if, @foreach, and other directives.
  • Layout Inheritance: Create a base layout file and extend it in other views (@extends('layouts.app')).
  • Components: Create reusable components for common UI elements.

Day 6 - Eloquent ORM Basics

  • Defining Models: Use php artisan make:model ModelName to create models.
  • Database Migrations: Create migration files to define database structure (php artisan make:migration create_table_name).
  • Seeding the Database: Use seeders to populate the database with initial data.

Day 7 - Relationships in Eloquent

  • Model Relationships: Understand one-to-one, one-to-many, and many-to-many relationships.
  • Eager Loading: Optimize queries using eager loading to avoid N+1 query problems.

Day 8 - Validations

  • Request Validation: Use request()->validate([...]) to validate incoming request data.
  • Custom Validation Messages: Customize error messages for validation rules.

Day 9 - Authentication

  • Setting Up Authentication: UseLaravel Breeze or Fortify for authentication scaffolding.
  • Registration and Login Logic: Implement user registration and login functionality in controllers.

Day 10 - Sending Emails

  • Mailables: Use php artisan make:mail to create mailables for sending emails.
  • Mail Configuration: Configure mail drivers (SMTP, Mailgun, etc.) in .env file.

Day 11 - Queues

  • Job Queues: Introduce background processing for long-running tasks using queues.
  • Workers: Run workers to process queued jobs.

Day 12 - Authorization

  • Gates and Policies: Use gates to authorize actions and policies to group authorization logic for models.

Day 13 - Asset Bundling with Vite

  • Vite: Use Vite for asset bundling and hot module replacement.
  • Tailwind CSS: Set up Tailwind CSS for styling.

Day 14 - Final Project Setup

  • Creating a Jobs Platform: Set up a project structure for a job listing application.

Day 15 - Building Job Listings

  • Eloquent Relationships: Set up relationships between jobs, employers, and users.
  • CRUD Operations: Implement create, read, update, delete operations for job listings.

Day 16 - Forms

  • Creating Forms: Use Blade components to create reusable form elements.
  • CSRF Protection: Implement CSRF protection for forms.

Day 17 - Validation

  • Server-Side Validation: Validate request data before processing.
  • Error Handling: Handle validation errors and display them in forms.

Day 18 - Refining Features

  • Job Searching: Implement job search functionality and filter jobs based on tags.

Day 19 - Routes Reloaded

  • Route Model Binding: Simplify route definitions and use implicit model binding.
  • Dedicated Controllers: Use dedicated controller classes for improved organization.

Day 20 - Authentication Review

  • Implementing Authentication Manually: Build custom authentication routes and logic without starter kits.
  • Middleware for Authorization: Use middleware to protect routes and enforce authentication.

Final Overview

  • Mail and Queues: Use mailables and queues to handle email delivery.
  • Testing and Validation: Implement testing and validation for form submissions.
  • Final Project Completion: Wrap up the project with all implemented features.