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:
- As a visitor, I can register for an account
- As a visitor, I can log in to my account
- As a user, I can create new tasks with title, description, and due date
- As a user, I can view all my tasks
- As a user, I can mark tasks as complete or incomplete
- As a user, I can edit my tasks
- As a user, I can delete my tasks
- As a user, I can create categories to organize my tasks
- As a user, I can assign tasks to categories
- As a user, I can filter tasks by category or completion status
- As a user, I can see statistics on my dashboard
Technology Stack
| Layer | Technology | Purpose |
|---|---|---|
| Backend | Laravel 13 | Framework |
| Database | SQLite | Development database |
| ORM | Eloquent | Database interactions |
| Templating | Blade | Server-side rendering |
| CSS | Tailwind CSS | Styling |
| Auth | Livewire starter kit (Fortify) | Authentication scaffolding |
Development Steps
- Setup: Run
laravel newand select the Livewire starter kit for auth - Database: Create migrations for tasks and categories
- Models: Define Eloquent models and relationships
- Routes: Define web routes for all pages
- Controllers: Create controllers with CRUD methods
- Views: Build Blade templates with Tailwind CSS
- Validation: Add form validation
- Authorization: Ensure users can only access their own data
- 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:
- Create the database structure
- Build the Task and Category models
- Create controllers and views
- Add the business logic
Let's start building!
Common Pitfalls
- Modelling too much up-front — Start with the minimum viable schema. You can always add columns later with a migration.
- Skipping authorization — Every row needs to be scoped to its owner. Plan that now, not after the first security report.
Best Practices
- Sketch the route table first — It forces you to think in terms of HTTP verbs + URIs + controller methods.
- 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.