Laravel
Routing Basics
3 topics
Defining Routes
How to define basic routes in Laravel.
// web.php
Route::get('/home', function () {
return view('home');
});Use named routes for better readability.
Group routes for similar functionality.
Route Parameters
Passing parameters to routes.
// web.php
Route::get('/user/{id}', function ($id) {
return 'User '.$id;
});Validate route parameters using regular expressions.
Use optional parameters with default values.
Route Middleware
Applying middleware to routes.
// web.php
Route::get('/dashboard', function () {
return view('dashboard');
})->middleware('auth');Use middleware to protect routes.
Create custom middleware for specific needs.
Eloquent ORM
3 topics
Basic Queries
Performing basic database queries using Eloquent.
// Retrieve all users
$users = User::all();
// Find a user by ID
$user = User::find(1);Use Eloquent for cleaner and more readable database interactions.
Leverage Eloquent relationships for complex queries.
Creating Records
Adding new records to the database.
// Create a new user
$user = new User;
$user->name = 'John Doe';
$user->email = '[email protected]';
$user->save();Use mass assignment for bulk record creation.
Validate data before saving to the database.
Updating Records
Modifying existing records in the database.
// Update a user
$user = User::find(1);
$user->email = '[email protected]';
$user->save();Use the update method for cleaner updates.
Always check if the record exists before updating.
Blade Templates
3 topics
Displaying Data
Using Blade syntax to display data in views.
<!-- home.blade.php -->
<h1>Welcome, {{ $name }}</h1>Escape output using {{ }} to prevent XSS attacks.
Use {!! !!} for unescaped output.
Control Structures
Using control structures like loops and conditionals.
<!-- users.blade.php -->
@foreach ($users as $user)
<p>{{ $user->name }}</p>
@endforeachUse @foreach for looping through arrays.
Use @if for conditional rendering.
Template Inheritance
Creating reusable layouts using Blade inheritance.
<!-- layouts/app.blade.php -->
<!DOCTYPE html>
<html>
<head>
<title>@yield('title')</title>
</head>
<body>
@yield('content')
</body>
</html>
<!-- home.blade.php -->
@extends('layouts.app')
@section('title', 'Home Page')
@section('content')
<h1>Welcome to the Home Page</h1>
@endsectionUse @extends to inherit layouts.
Use @yield to define placeholders for content.
Artisan Commands
2 topics
Basic Commands
Common Artisan commands for Laravel projects.
# Start the development server
php artisan serve
# Clear application cache
php artisan cache:clearUse php artisan list to see all available commands.
Run php artisan help <command> for detailed usage.
Creating Custom Commands
How to create your own Artisan commands.
// Create a new command
php artisan make:command MyCustomCommand
// MyCustomCommand.php
protected $signature = 'custom:command';
protected $description = 'Description of the custom command';
public function handle()
{
$this->info('Custom command executed!');
}Use descriptive names for commands.
Leverage the handle method for command logic.
Testing in Laravel
3 topics
Unit Testing
Writing unit tests for your application.
// ExampleTest.php
public function test_example()
{
$response = $this->get('/');
$response->assertStatus(200);
}Use PHPUnit for unit testing.
Run tests using php artisan test.
Feature Testing
Testing application features.
// FeatureTest.php
public function test_home_page()
{
$response = $this->get('/home');
$response->assertSee('Welcome');
}Use feature tests for end-to-end testing.
Mock dependencies for isolated tests.
Database Testing
Testing database interactions.
// DatabaseTest.php
public function test_database()
{
User::factory()->create(['name' => 'John Doe']);
$this->assertDatabaseHas('users', ['name' => 'John Doe']);
}Use factories for test data.
Clean up test data using transactions.
Related Cheat Sheets
More hands-on references connected to this topic.
Python syntax, data structures, comprehensions, OOP, error handling, and standard library essentials.
keyword overlap
kubectl commands, Pod/Deployment/Service manifests, config management, and cluster operations.
same difficulty, keyword overlap
LangGraph stateful agents, graph nodes, edges, checkpointing, and multi-agent workflows.
same difficulty, keyword overlap
Complete guide to building AI agents — architecture, tool use, memory, planning patterns, multi-agent systems, frameworks, evaluation, and production best practices.
same difficulty, keyword overlap
Related Articles
Background reading and deeper explanations for this sheet.
Intro to FastAPI: Build a Production-Ready Python API with Real Examples
FastAPI is one of the fastest ways to build modern APIs in Python without sacrificing code quality or developer experience. In this practical, beginner-friendly guide, you’ll learn how to create endpoints, validate data, handle errors, connect a database, secure routes, and prepare your FastAPI app for real-world deployment.
keyword overlap
Cost Optimization in Agentic Systems: The Most Underrated Lever for Reliable AI at Scale
Most teams building agentic systems obsess over accuracy and latency, but ignore the fastest path to sustainable scale: cost optimization. In this guide, you’ll learn practical cost models, real architecture patterns, and implementation tactics to cut spend without sacrificing quality or autonomy.
keyword overlap
GenAI SaaS Architecture: A Practical Blueprint for Building, Scaling, and Securing AI Products
Designing a SaaS product on top of GenAI is more than calling an LLM API—it requires thoughtful architecture across product, data, safety, and operations. This practical guide walks you through a beginner-friendly yet deep system blueprint, with real-world patterns, code snippets, and deployment strategies you can use immediately.
keyword overlap
Multi-Tenant AI Systems: A Practical Guide to Building Secure, Scalable, High-Value Platforms
Multi-tenant AI systems let you serve many customers from one platform—but getting isolation, cost control, and model quality right is hard. This practical guide breaks down architecture, security, data design, and operations with real-world examples so you can build confidently from day one.
keyword overlap