Introduction

Before writing code, it pays to sketch the domain, the routes, and the data model on paper. This lesson walks through planning a task-manager app so every subsequent lesson has a clear target.

Key Concepts

  • User stories: Short sentences describing who does what and why.
  • Data model: The tables, columns, and relationships the app needs.
  • RESTful routes: A convention that maps CRUD actions to HTTP verbs.
  • Authentication scaffolding: Laravel's official starter kits provide ready-made login, register, and password reset flows.
  • Tech stack: Laravel 13, Blade, Tailwind, SQLite — the defaults that ship with the installer.

Real World Context

Every feature begins with a question: what are the user stories, and what tables back them? Answering these on paper catches design flaws you would otherwise discover three lessons in, after you had already scaffolded the wrong models.

Deep Dive

Before writing any code, let's plan the task management application we'll build. Good planning saves time and helps you understand how Laravel's pieces fit together.

What We're Building

We'll create a Task Manager application with these features:

  • User registration and authentication
  • Create, read, update, and delete tasks
  • Mark tasks as complete/incomplete
  • Organize tasks by categories
  • Filter and search tasks
  • Dashboard with task statistics

Application Architecture

┌─────────────────────────────────────────────────────────────────┐
│                         Task Manager                             │
├─────────────────────────────────────────────────────────────────┤
│  Routes          │  Controllers      │  Views                   │
│  ─────────────   │  ─────────────    │  ─────────────          │
│  /               │  HomeController   │  home.blade.php          │
│  /dashboard      │  DashboardCtrl    │  dashboard.blade.php     │
│  /tasks          │  TaskController   │  tasks/index.blade.php   │
│  /tasks/create   │  TaskController   │  tasks/create.blade.php  │
│  /tasks/{id}     │  TaskController   │  tasks/show.blade.php    │
│  /tasks/{id}/edit│  TaskController   │  tasks/edit.blade.php    │
│  /categories     │  CategoryCtrl     │  categories/*.blade.php  │
├─────────────────────────────────────────────────────────────────┤
│  Models                                                          │
│  ─────────────────────────────────────────────────────────────  │
│  User        │  Task           │  Category                       │
│  - id        │  - id           │  - id                           │
│  - name      │  - user_id (FK) │  - user_id (FK)                 │
│  - email     │  - category_id  │  - name                         │
│  - password  │  - title        │  - color                        │
│              │  - description  │  - created_at                   │
│              │  - completed    │  - updated_at                   │
│              │  - due_date     │                                 │
│              │  - created_at   │                                 │
│              │  - updated_at   │                                 │
└─────────────────────────────────────────────────────────────────┘

Database Relationships

User (1) ──────< (Many) Task
  │
  └──────< (Many) Category

Category (1) ──────< (Many) Task
  • A User has many Tasks
  • A User has many Categories
  • A Category has many Tasks
  • A Task belongs to a User and a Category

User Stories

Let's define what users can do:

  1. As a visitor, I can register for an account
  2. As a visitor, I can log in to my account
  3. As a user, I can create new tasks with title, description, and due date
  4. As a user, I can view all my tasks
  5. As a user, I can mark tasks as complete or incomplete
  6. As a user, I can edit my tasks
  7. As a user, I can delete my tasks
  8. As a user, I can create categories to organize my tasks
  9. As a user, I can assign tasks to categories
  10. As a user, I can filter tasks by category or completion status
  11. As a user, I can see statistics on my dashboard

Technology Stack

LayerTechnologyPurpose
BackendLaravel 13Framework
DatabaseSQLiteDevelopment database
ORMEloquentDatabase interactions
TemplatingBladeServer-side rendering
CSSTailwind CSSStyling
AuthLivewire starter kit (Fortify)Authentication scaffolding

Development Steps

  1. Setup: Run laravel new and select the Livewire starter kit for auth
  2. Database: Create migrations for tasks and categories
  3. Models: Define Eloquent models and relationships
  4. Routes: Define web routes for all pages
  5. Controllers: Create controllers with CRUD methods
  6. Views: Build Blade templates with Tailwind CSS
  7. Validation: Add form validation
  8. Authorization: Ensure users can only access their own data
  9. Polish: Add filtering, searching, and statistics

Project Setup

Let's start by creating the project. In Laravel 13 the installer is interactive — it asks which starter kit you want (React, Vue, Svelte, or Livewire) and runs the initial migrations for you:

bash
# Create a new Laravel project (installer prompts for starter kit, test framework, database)
laravel new task-manager

# Pick the Livewire starter kit when prompted — it's the Blade-based option
# backed by Laravel Fortify for authentication.

cd task-manager

# Install NPM dependencies and build the frontend assets
npm install
npm run build

# Start the development server, queue worker, and Vite in parallel
composer run dev

Now visit http://localhost:8000 — you should see the Laravel welcome page with working Register and Login links. The Livewire starter kit ships all of that out of the box.

What the Livewire Starter Kit Gives You

The Livewire starter kit provides a complete Blade + Livewire authentication scaffold backed by Laravel Fortify:

  • Registration page at /register
  • Login page at /login
  • Password reset flow
  • Email verification (optional)
  • Profile management at /settings/profile
  • Dashboard at /dashboard
  • Tailwind CSS styling
  • Livewire + Flux UI for reactive components without leaving PHP

Next Steps

With authentication ready, we'll:

  1. Create the database structure
  2. Build the Task and Category models
  3. Create controllers and views
  4. Add the business logic

Let's start building!

Common Pitfalls

  1. Modelling too much up-front — Start with the minimum viable schema. You can always add columns later with a migration.
  2. Skipping authorization — Every row needs to be scoped to its owner. Plan that now, not after the first security report.

Best Practices

  1. Sketch the route table first — It forces you to think in terms of HTTP verbs + URIs + controller methods.
  2. Pick a starter kit during laravel new — Livewire for Blade-based apps, or React/Vue/Svelte for Inertia SPAs. All of them scaffold register, login, password reset, and profile in one step.

Summary

  • Plan the data model and routes before touching code.
  • Write 5–10 user stories to capture requirements.
  • Use RESTful conventions for predictable URLs.
  • Laravel 13's official starter kits (Livewire, React, Vue, Svelte) scaffold complete authentication during laravel new.
  • Tailwind + Blade is the default rendering stack for starter kits.
✓ Completed