Minimal CRUD for a Task with fields: title (string), description (text, optional), completed (boolean).
- Search across title and description
- Status filters: All, Pending, Completed
- Inline editing on the list (no separate edit page)
- Clean, beginner-friendly Create page
- Delete with confirmation
- Minimal CSS; no build tools required
- Laravel 12, PHP 8.2+
- MySQL (Laragon) by default
- Blade templates (no Node/Vite required)
- Make sure PHP 8.2+, Composer, and MySQL (Laragon) are installed and MySQL is running.
- Create database (or use Laragon UI):
mysql -uroot -e "CREATE DATABASE IF NOT EXISTS laravel CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
- Copy env file and set DB connection:
cp .env.example .env- Update
.env:DB_CONNECTION=mysqlDB_HOST=127.0.0.1DB_PORT=3306DB_DATABASE=laravelDB_USERNAME=rootDB_PASSWORD=(empty unless you changed it)
- Install dependencies:
composer install - App key:
php artisan key:generate - Migrate database:
php artisan migrate - (Optional) Seed demo data (first run):
- Recommended:
php artisan migrate:fresh --seed - If you later see a duplicate email error while seeding, use
php artisan migrate:fresh --seedto reset and reseed cleanly.
- Recommended:
- Run the app:
php artisan serve - Open
http://127.0.0.1:8000→ Tasks index
- GET
/→ redirects totasks.index - GET
/tasks→ list tasks - GET
/tasks/create→ create form - POST
/tasks→ store - GET
/tasks/{task}→ defined but redirects to list (inline editing used) - GET
/tasks/{task}/edit→ defined but redirects to list (inline editing used) - PUT
/tasks/{task}→ update - DELETE
/tasks/{task}→ delete
- Model:
app/Models/Task.php - Controller:
app/Http/Controllers/TaskController.php - Routes:
routes/web.php - Views:
resources/views/tasks/*.blade.php - Migration:
database/migrations/*_create_tasks_table.php
- Duplicate email error when seeding: run
php artisan migrate:fresh --seedto reset the DB, or editdatabase/seeders/DatabaseSeeder.phpto skip creating the sample user if it already exists. - Port already in use: stop other PHP servers or run
php artisan serve --port=8001. - Database connection issues: verify
.envDB settings and that MySQL is running.
Laravel has the most extensive and thorough documentation and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
You may also try the Laravel Bootcamp, where you will be guided through building a modern Laravel application from scratch.
If you don't feel like reading, Laracasts can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.