Toolkit for switching languages
Quick lookups for when you are mid-task: a concept map, Laravel commands translated to Laravel Go and Laravel Rust, a CLI command map, the classic gotchas, a learning roadmap, a guide to choosing a stack and curated resources.
Versions this site covers
Code is written for the versions below and works on anything newer unless a snippet carries a version tag such as Go 1.27+. Latest releases checked December 5, 2026.
PHP
- Written for
- 8.4
- Latest release
- 8.6.0
- Works on
- PHP 8.4 and newer
Property hooks, asymmetric visibility and new without brackets are used freely. Newer features such as the PHP 8.5 pipe operator and PHP 8.6 partial application appear as "New in" notes. Release notes
Go
- Written for
- 1.26
- Latest release
- 1.27.4
- Works on
- Go 1.26 and newer
Generics, range-over-func iterators, wg.Go, new(expr) and errors.AsType are used freely. Go 1.27 additions such as generic methods and encoding/json/v2 appear as "New in" notes. Release notes
Rust
- Written for
- 1.85, 2024 edition
- Latest release
- 1.100.1
- Works on
- Rust 1.85 and newer
Every snippet uses the 2024 edition. Later additions such as let chains (1.88) appear as "New in" notes. Release notes
Laravel
- Written for
- 13.x
- Latest release
- 13.45.0
- Works on
- Laravel 13 on PHP 8.3+
Laravel 13 conventions: attribute-based models such as #[Fillable], and PreventRequestForgery for CSRF. Most snippets also work on Laravel 12. Release notes
Laravel Go
- Written for
- 0.2.0
- Latest release
- 0.2.0
- Works on
- v0.2 on Go 1.27+
Beta: the API may change before 1.0. Every snippet comes from the v0.2.0 docs. Release notes
Laravel Rust
- Written for
- 0.2.0
- Latest release
- 0.2.0
- Works on
- v0.2 on Rust 1.99+ (2024 edition)
Beta: the API may change before 1.0. Every snippet comes from the v0.2.0 docs. Release notes
Rosetta map
The same idea in each language, one row per concept.
Types & values
| Concept | PHP | Go | Rust |
|---|---|---|---|
| Integer | int (64-bit, overflows to float) | int, int64, uint8… (fixed size, wraps) | i32, i64, u8, usize… (panics on overflow in debug) |
| Float | float | float64, float32 | f64, f32 |
| Boolean | bool | bool | bool |
| String | string (byte string) | string (immutable UTF-8 bytes) | String (owned) and &str (borrowed view) |
| Character | No type: a one-char string | rune (Unicode code point), byte | char (Unicode scalar), u8 |
| Null / absent | null, ?User | nil for pointers, maps, slices, interfaces; zero values for the rest | Option<T>: Some(x) or None |
| Any type | mixed | any (alias of interface{}) | Generics, or Box<dyn Any> (rare) |
| Union type | int|string | Only in generic constraints: int | string | enum with one variant per case |
| Convert / cast | (int) $x, intval($s) | int64(x), strconv.Atoi(s) | x as i64, s.parse::<i32>()?, i64::from(x) |
| Constants | const MAX = 10;, define() | const Max = 10 (compile-time; untyped unless you give it a type) | const MAX: u32 = 10;, static |
| Check type at runtime | instanceof, get_debug_type() | Type switch: switch v := x.(type) | match on enum variants; downcast_ref for dyn Any |
| Integer division | 7 / 2 is 3.5; use intdiv(7, 2) | 7 / 2 is 3 | 7 / 2 is 3 |
Syntax
| Concept | PHP | Go | Rust |
|---|---|---|---|
| Declare a variable | $x = 1; | x := 1 or var x int | let x = 1; or let mut x = 1; |
| Semicolons | Required | Not written (inserted by the compiler) | Required; a final expression without ; is the block's value |
| Interpolation | "Hi {$name}" | fmt.Sprintf("Hi %s", name) | format!("Hi {name}") |
| Print / debug | echo, dump(), dd() | fmt.Println, fmt.Printf("%+v", v) | println!, dbg!(v), {:?} |
| Function | function add(int $a, int $b): int | func add(a, b int) int | fn add(a: i32, b: i32) -> i32 |
| Closure | fn($x) => $x * 2 | func(x int) int { return x * 2 } | |x| x * 2 |
| Ternary | $a ? $b : $c | None: use if/else | if a { b } else { c } is an expression |
| Null coalescing | $a ?? 'default' | Explicit if v == nil check | opt.unwrap_or("default") |
| Match / switch | match ($x) { 1, 2 => 'low', default => 'high' } | switch x { case 1, 2: … default: … } (no implicit fallthrough) | match x { 1 | 2 => "low", _ => "high" } (must be exhaustive) |
| Loop a collection | foreach ($items as $k => $v) | for k, v := range items | for (i, v) in items.iter().enumerate() |
| Doc comments | /** PHPDoc */ | // Name does… above the declaration | /// Markdown docs, with runnable examples |
| Variadic | function f(...$args), f(...$list) | func f(args ...int), f(xs...) | Take a slice &[T], or use a macro |
Data structures
| Concept | PHP | Go | Rust |
|---|---|---|---|
| List | [1, 2, 3] | Slice: []int{1, 2, 3} | vec![1, 2, 3] (Vec<i32>) |
| Fixed-size array | SplFixedArray | [3]int{1, 2, 3} | [1, 2, 3] ([i32; 3]) |
| Map | ['a' => 1] | map[string]int{"a": 1} | HashMap::from([("a", 1)]) |
| Ordered map | Arrays keep insertion order | Maps are unordered: sort the keys | BTreeMap (sorted) or the indexmap crate |
| Set | array_unique() or array keys | map[string]struct{} | HashSet<T>, BTreeSet<T> |
| Append | $a[] = 4; | a = append(a, 4) | v.push(4); |
| Length | count($a) | len(a) | v.len() |
| Contains | in_array($x, $a, true) | slices.Contains(a, x) | v.contains(&x) |
| Map / filter | array_map, array_filter, collect() | for loops; slices and maps packages | .iter().map(…).filter(…).collect() |
| Sort | sort($a), usort($a, fn…) | slices.Sort(a), slices.SortFunc(a, cmp) | v.sort(), v.sort_by_key(|u| u.age) |
| Tuple / multiple values | [$a, $b] = f(); | a, b := f() | let (a, b) = f(); |
| Queue / stack | SplQueue, array_shift, array_pop | Slice operations, container/list | VecDeque, Vec::pop |
OOP & abstraction
| Concept | PHP | Go | Rust |
|---|---|---|---|
| Class / type | class User { } | type User struct { } + methods | struct User { } + impl User { } |
| Constructor | __construct() with property promotion | Convention: func NewUser(…) *User | Convention: fn new(…) -> Self |
| Method | public function name(): string | func (u *User) Name() string | fn name(&self) -> &str |
| Visibility | public, protected, private | Capitalised = exported; lowercase = package-private | Private by default; pub, pub(crate) |
| Interface | interface Shape + implements Shape | type Shape interface { … }, satisfied implicitly | trait Shape + impl Shape for Circle |
| Inheritance | extends | None: struct embedding | None: traits + composition |
| Traits / mixins | trait HasSlug + use HasSlug; | Embedding a struct | Trait default methods |
| Static method | public static function make() | Package-level function | Associated function: User::new() |
| Generics | PHPDoc @template T, checked by PHPStan | func Map[T, U any](…) | fn map<T, U>(…) with bounds T: Display |
| Magic methods | __get, __call, __toString | None; String() string (Stringer) | Traits: Display, Deref, From/Into, Index |
| Enum | enum Status: string { case Active = 'active'; } | const ( Active Status = iota … ) | enum Status { Active, Banned { reason: String } } |
| Equality | == (loose), === (strict / same instance) | == on comparable structs | #[derive(PartialEq)], then == |
Errors & nullability
| Concept | PHP | Go | Rust |
|---|---|---|---|
| Signal an error | throw new DomainException('…') | return nil, errors.New("…") | return Err(AppError::NotFound) |
| Handle it | try { } catch (E $e) { } | if err != nil { … } | match res { Ok(v) => …, Err(e) => … } |
| Pass it up | Let it bubble | return fmt.Errorf("load: %w", err) | The ? operator |
| Custom error | class NotFound extends Exception | A type with Error() string | An enum with #[derive(thiserror::Error)] |
| Inspect a wrapped error | $e->getPrevious() | errors.Is, errors.As | Match the variant; downcast_ref with anyhow |
| Cleanup | finally | defer f.Close() | Drop runs when the value goes out of scope |
| Crash | Uncaught exception, exit() | panic() (for bugs, not control flow) | panic!, .unwrap(), .expect("…") |
| Optional value | ?User / null | *User (nil) or (User, bool) | Option<User> |
| Null-safe chain | $user?->profile?->bio | Explicit nil checks | user.and_then(|u| u.profile), or ? inside a fn returning Option |
| Default when missing | $x ?? 'n/a' | v, ok := m[k]; if !ok { … } | .unwrap_or("n/a"), .unwrap_or_default() |
Tooling
| Concept | PHP | Go | Rust |
|---|---|---|---|
| Package manager | Composer | The go command (modules) | Cargo |
| Registry | Packagist | Any git repo via proxy.golang.org; browse on pkg.go.dev | crates.io; docs on docs.rs |
| Version manager | Herd, Homebrew | toolchain line in go.mod, or go.dev/dl | rustup |
| Formatter | Pint, PHP-CS-Fixer | gofmt (built in) | cargo fmt (rustfmt) |
| Static analysis | PHPStan / Larastan, Psalm | go vet, staticcheck, golangci-lint | The compiler + cargo clippy |
| Test runner | Pest, PHPUnit | go test | cargo test |
| Debugger | Xdebug | Delve (dlv) | lldb / gdb, CodeLLDB in VS Code |
| Language server | Intelephense, Phpactor | gopls | rust-analyzer |
| REPL | php artisan tinker, php -a | None built in; go.dev/play | None built in; play.rust-lang.org, evcxr |
| Profiler | Xdebug profiler, Blackfire, SPX | pprof | perf, samply, cargo-flamegraph |
| API docs | phpDocumentor | go doc, pkg.go.dev | cargo doc, docs.rs |
Project files
| Concept | PHP | Go | Rust |
|---|---|---|---|
| Manifest | composer.json | go.mod | Cargo.toml |
| Lockfile | composer.lock | go.sum (checksums) | Cargo.lock |
| Dependencies live in | vendor/ | Module cache (go env GOMODCACHE); go mod vendor optional | ~/.cargo/registry; builds go to target/ |
| Entry point | public/index.php | main.go: package main + func main() | src/main.rs: fn main() |
| Library root | PSR-4 src/ | Each directory is one package | src/lib.rs |
| Namespace | namespace App\Models; | package models | mod models; |
| Import | use App\Models\User; | import "example.com/app/models" | use crate::models::User; |
| Autoloading | Composer PSR-4 autoloader | Compiler resolves imports | Compiler resolves modules |
| Environment config | .env + env() | os.Getenv, godotenv | std::env::var, dotenvy |
| Build output | None (source + OPcache) | One static binary | One binary in target/release/ |
| Project scripts | "scripts" in composer.json | Makefile or Taskfile | Cargo aliases in .cargo/config.toml, or just |
Laravel ↔ Laravel Go ↔ Laravel Rust
Where each Laravel habit lives in the other two frameworks.
Project & CLI
| Task | Laravel | Laravel Go | Laravel Rust |
|---|---|---|---|
| New project | laravel new blog | laravel new blog --go (Inertia + React starter) | laravel new blog --rust (Inertia + React starter) |
| Run dev server | composer run dev or php artisan serve | laravel dev (server, queue worker and Vite, rebuilds on save) or laravel serve | laravel dev (server, queue worker and Vite, rebuilds on save) or laravel serve |
| Make a controller | php artisan make:controller PostController | No generator (not in v0.2): write handler funcs in a handlers/posts package | No generator (not in v0.2): write async handler fns, e.g. src/http/handlers/posts.rs |
| Make a model | php artisan make:model Post -m | No generator (not in v0.2): a struct in models/ | No generator (not in v0.2): a #[model] struct in src/models/ |
| Make a migration | php artisan make:migration create_posts_table | laravel make:migration create_posts_table | laravel make:migration create_posts_table |
| Full CRUD scaffold | php artisan make:model Post -mcr (no views) | No scaffold (not in v0.2); route.Resource("posts", routing.Resource{…}) wires the CRUD routes | No scaffold (not in v0.2) |
| List routes | php artisan route:list | laravel route:list (or go run . route:list) | laravel route:list (or cargo run -- route:list) |
| App key / secrets | php artisan key:generate | laravel key:generate (laravel new sets APP_KEY for you) | laravel key:generate (laravel new sets APP_KEY for you) |
| Environment check | php artisan about | No about command (not in v0.2); laravel list shows every command | No about command (not in v0.2); laravel list shows every command |
| Config files | .env + config/*.php | .env + a typed config.Config; settings that need code go in a Configure function in bootstrap/app.go | .env + #[config::section] functions in src/config/*.rs |
HTTP
| Task | Laravel | Laravel Go | Laravel Rust |
|---|---|---|---|
| Define a route | Route::get('/posts', [PostController::class, 'index']) | route.Get("/posts", posts.Index) in routes/web.go | route.get("/posts", posts::index) |
| Route parameter | /posts/{id} + $id argument | /posts/{post} + r.PathValue("post") or r.PathInt | /posts/{post} + Params(id): Params<u64> extractor (or a post: Post argument) |
| Route group | Route::prefix('api')->middleware('auth')->group(…) | route.Prefix("/admin").Middleware(auth.Authenticate{}).Group(func(route *routing.Router) {…}) | route.prefix("/admin").middleware(Authenticate).group(|route| {…}) |
| Read input | $request->input('title') | input, err := r.Bind[NewPost]() (struct with json tags) | Valid(form): Valid<StorePost> for the body, Query(f): Query<Filters> for the query string |
| Validate | $request->validate([...]) or a FormRequest | Struct with a Rules() method, then form, err := r.Validate[StorePost]() | #[laravel::input(fills = Post)] struct with #[validate(required, max_length(255))], taken as Valid<StorePost> |
| JSON response | response()->json($post, 201) | web.JSON(post), or web.Created(post) for a 201 | Json(post), or Created<Post> for a 201 |
| Render a view | view('posts.index', compact('posts')) | web.View("posts.index", posts) (html/template), or inertia.Render("Posts/Index", inertia.Props{…}) | view("posts.index", data! { posts }) (Jinja), or inertia::render("Posts/Index", props! { posts }) |
| Middleware | php artisan make:middleware | A type with Handle(r *web.Request, next web.Next) *web.Response (no generator in v0.2) | A #[middleware] async fn taking (request: Request, next: Next) (no generator in v0.2) |
| Current user | $request->user() | r.User[models.User]() (or models.CurrentUser) | Authenticated(user): Authenticated<User> extractor, or Auth<User> |
Data
| Task | Laravel | Laravel Go | Laravel Rust |
|---|---|---|---|
| All rows | Post::all() | model.Query[models.Post]().Get(r) | Post::all().await? |
| Find or 404 | Post::findOrFail($id) | model.Find[models.Post](r, id); its not-found error becomes a 404 via web.Fail | Post::find_or_fail(id).await? |
| Where | Post::where('published', true)->get() | model.Query[models.Post]().WhereEq("published", true).Get(r) | Post::query().filter(Post::published_at.is_not_null()).get().await? |
| Create | Post::create([...]) | model.Create(r, &post) | create!(Post { ..form }).await? |
| Eager-load relation | Post::with('comments')->get() | model.Query[models.Post]().With("user", "comments").Get(r) | Post::query().with(Post::comments.with(Comment::user)) |
| Paginate | Post::paginate(15) | .Paginate(r, r.Page(15)) | .paginate(15).await? |
| Run migrations | php artisan migrate | laravel migrate (production: ./app migrate --force) | laravel migrate (production: ./app migrate --force) |
| Roll back | php artisan migrate:rollback | No rollback: migrations are forward-only, write a new migration | No rollback: migrations are forward-only, write a new migration |
| Fresh + seed | php artisan migrate:fresh --seed | laravel migrate:fresh --seed | laravel migrate:fresh --seed |
| Regenerate entities | Not needed (Eloquent reads columns at runtime) | Not needed (models are hand-written structs) | Not needed (#[model] structs are hand-written) |
Background & ops
| Task | Laravel | Laravel Go | Laravel Rust |
|---|---|---|---|
| Make a job | php artisan make:job SendReport | laravel make:job SendReport (adds it to jobs.All) | No generator (not in v0.2): #[derive(Queueable)] struct + #[job] impl, auto-discovered |
| Dispatch a job | SendReport::dispatch($user) | queue.Dispatch(r, jobs.SendReport{UserID: user.ID}) | SendReport { user_id }.dispatch().await? |
| Run workers | php artisan queue:work | laravel queue:work (production: ./app queue:work) | laravel queue:work |
| Schedule tasks | Schedule::command(…)->daily() in routes/console.php | s.Command("reports:send").Daily() in Schedule (commands/schedule.go); cron runs ./app schedule:run | schedule.command("reports:send").daily() in a #[schedule::tasks] fn; cron runs schedule:run |
| Custom command | php artisan make:command | laravel make:command posts:prune | No generator (not in v0.2): a #[command("posts:prune")] async fn in src/console/ |
| Send mail | Mail::to($u)->send(new Welcome) | mail.To(user).Queue(r, mails.Welcome{}) (or Send) | mail::to(&user).queue(Welcome).await? (or send) |
| Cache | Cache::remember('k', 60, fn () => …) | cache.Remember(r, "k", time.Hour, func(ctx context.Context) (T, error) {…}) | cache::remember("k", 10.minutes(), async || {…}).await? |
| File storage | Storage::put('a.txt', $contents) | storage.Put(r, "a.txt", contents) | storage::put("a.txt", contents).await? |
| Run tests | php artisan test | go test ./... (feature tests use the laraveltest client) | cargo test (#[laravel::test] functions) |
| Production build | composer install --no-dev -o + php artisan optimize | go build -o app . (set GOOS/GOARCH to cross-compile) | cargo build --release |
CLI command map
Composer and PHP commands next to their Go and Cargo equivalents.
| Task | PHP | Go | Rust |
|---|---|---|---|
| Start a project | composer init | go mod init example.com/app | cargo new app |
| Add a dependency | composer require vendor/pkg | go get example.com/pkg@latest | cargo add pkg |
| Add a dev dependency / tool | composer require --dev pestphp/pest | go get -tool golang.org/x/tools/cmd/stringer | cargo add --dev mockall |
| Remove a dependency | composer remove vendor/pkg | Delete the import, then go mod tidy | cargo remove pkg |
| Install from lockfile | composer install | go mod download | cargo fetch (or just cargo build) |
| Update dependencies | composer update | go get -u ./... then go mod tidy | cargo update (compatible versions) |
| List outdated | composer outdated | go list -m -u all | cargo outdated (plugin) |
| Why is this installed? | composer why vendor/pkg | go mod why -m example.com/pkg | cargo tree -i pkg |
| Dependency tree | composer show --tree | go mod graph | cargo tree |
| Run | php script.php | go run . | cargo run |
| Build for production | composer install --no-dev -o | go build -o bin/app . | cargo build --release |
| Fast type check | vendor/bin/phpstan analyse | go vet ./... (or go build ./...) | cargo check |
| Run all tests | php artisan test / vendor/bin/pest | go test ./... | cargo test |
| Run one test | vendor/bin/pest --filter=creates_post | go test -run TestCreatePost ./... | cargo test create_post |
| Race / safety checks | n/a | go test -race ./... | The compiler (data races don't compile); cargo miri test for unsafe |
| Coverage | vendor/bin/pest --coverage | go test -cover ./... | cargo llvm-cov or cargo tarpaulin (plugins) |
| Benchmark | vendor/bin/phpbench run | go test -bench=. ./... | cargo bench |
| Format | vendor/bin/pint | go fmt ./... | cargo fmt |
| Lint | vendor/bin/phpstan analyse | golangci-lint run | cargo clippy |
| Security audit | composer audit | govulncheck ./... | cargo audit (plugin) |
| Read package docs | Package README / phpDocumentor | go doc net/http.Client | cargo doc --open |
| Quick experiment | php artisan tinker, 3v4l.org | go.dev/play | play.rust-lang.org |
| Cross-compile | n/a (ship source) | GOOS=linux GOARCH=arm64 go build | cargo build --target x86_64-unknown-linux-musl or cross build |
| Update the toolchain | Herd, or brew upgrade php | Download from go.dev/dl, or set toolchain in go.mod | rustup update |
| Clean build caches | composer clear-cache | go clean -cache | cargo clean |
Gotchas for PHP developers
The mistakes almost every PHP developer makes in the first month.
Go
Writing to a nil map panics
A declared but unmade map is nil: reads work, writes crash. Always create it: m := make(map[string]int) or m := map[string]int{}.
Slices share their backing array
b := a[:2] is a view, so b[0] = 9 changes a too, and append may or may not copy. Use slices.Clone(a) when you need an independent copy.
:= can shadow outer variables
Inside an if or for block, x, err := f() creates a new err and leaves the outer one untouched. Use = when the variable already exists.
A nil pointer in an interface is not nil
var p *MyErr; var err error = p gives err != nil == true, because the interface holds a type. Return a literal nil for "no error".
There are no exceptions
Errors are return values and you check each one: if err != nil { return err }. panic is for programmer bugs, not for 404s or validation.
Unused imports and variables don't compile
PHP lets them slide; Go refuses to build. Assign to _ while sketching, and let goimports manage imports.
Lowercase fields are invisible
Only Capitalised names are exported, and that includes encoding/json and template access. A name string field never appears in JSON; export it as Name string and add the tag json:"name".
Zero values instead of null
A missing string is "", a missing int is 0. To tell "not sent" from "empty", use a pointer (*string) or sql.NullString.
Concurrent map writes crash the program
Maps aren't safe across goroutines: you get fatal error: concurrent map writes. Guard with sync.Mutex and run tests with go test -race.
Date formats use a reference time
No Y-m-d: you write the date Mon Jan 2 15:04:05 2006 in your format, e.g. t.Format("2006-01-02").
Strings are bytes
len("é") is 2. for i, r := range s walks runes (characters); s[i] gives a byte. Use utf8.RuneCountInString for character counts.
Old tutorials copy loop variables
Since Go 1.22 each loop iteration gets a fresh variable, so the v := v trick in older code is no longer needed. Check the go line in go.mod.
Rust
String vs &str
String owns heap data; &str borrows a view of it. Take &str in function parameters and return String when you create text: fn greet(name: &str) -> String.
Assignment moves values
let b = a; moves a String or Vec, and a is unusable afterwards. Numbers and other Copy types are copied. Borrow with &a or call a.clone().
One writer or many readers
You can't hold a &mut while any & borrow is alive. Shorten borrows with smaller scopes, or collect what you need before mutating.
.clone() is fine while learning
Cloning to get past the borrow checker is a legitimate first step. Optimise later, when a profiler says it matters.
No null, and unwrap() panics
Missing values are Option<T>. .unwrap() crashes on None; prefer ?, if let Some(x) = …, or .unwrap_or(default).
Integer overflow panics in debug builds
With let x: u8 = 255;, x + 1 panics in debug builds and wraps to 0 in release (a constant like 255u8 + 1 is rejected at compile time). Say what you mean: checked_add, saturating_add or wrapping_add.
Async needs a runtime
async fn returns a future that does nothing until awaited, and main needs a runtime: #[tokio::main] async fn main(). Don't block inside async code; use tokio::task::spawn_blocking.
The orphan rule
You can't implement a foreign trait for a foreign type (e.g. Display for Vec<T>). Wrap it in a newtype: struct Tags(Vec<String>);.
? needs a matching error type
? converts errors with From. In apps, return anyhow::Result<T>; in libraries, define an enum with thiserror.
You can't index a string
s[0] doesn't compile because UTF-8 characters vary in width. Use s.chars().next(), or byte slices you know sit on character boundaries.
References in structs need lifetimes
struct Post { title: &str } needs <'a> annotations. While learning, store owned Strings instead.
Compile times are real
Use cargo check while editing, keep the dev profile for iteration, and a faster linker (mold or lld) for big projects. Release builds are slower to compile but much faster to run.
Roadmap from Laravel to Go and Rust
A paced path from zero to shipping a Laravel Go or Laravel Rust app, a few hours a week.
- Weeks 1–2
Read both languages side by side
- Variables, types, strings, collections and control flow in Go and Rust
- Do the Tour of Go in full; Rust Book chapters 1–3
- Use this site's Basics level with PHP as your anchor
Build: A CLI that reads an orders CSV and prints totals per customer (Go first).
- Weeks 3–4
Go: structs, interfaces and errors
- Structs, methods, implicit interfaces, embedding
- Errors as values: wrapping with
%w,errors.Is/As - Modules, packages and
go testwith table-driven tests
Build: A JSON API with
net/httpmethod routes over an in-memory list of posts, fully tested. - Weeks 5–6
Go: concurrency and databases
- Goroutines, channels,
select,contexttimeouts errgroupandsync.Mutex; run everything with-race- Postgres with pgx, or sqlc for type-safe queries
Build: A concurrent URL health checker, then move the posts API onto Postgres.
- Goroutines, channels,
- Weeks 7–8
Laravel Go: Laravel, compiled
laravel new blog --go,laravel dev, routes inroutes/web.goand handler packages- Models with
model.Query, relationships, forward-only migrations, factories and seeders - Session auth,
r.Validate, queues, scheduling, mail, cache and Inertia pages
Build: Port a small Laravel app (posts + comments + auth) to Laravel Go.
- Weeks 9–11
Rust: ownership and the type system
- Rust Book chapters 4–10: ownership, borrowing, structs, enums,
Option/Result, traits, generics - Rustlings alongside the book
Stringvs&str, iterators and closures
Build: Rewrite the orders CSV CLI in Rust with clap and serde.
- Rust Book chapters 4–10: ownership, borrowing, structs, enums,
- Weeks 12–13
Rust: async and the web
- Tokio tasks,
.await, channels and timeouts - Axum routing, extractors and Tower layers
- sqlx queries, serde JSON,
tracinglogs
Build: Rebuild the posts JSON API with Axum + sqlx.
- Tokio tasks,
- Weeks 14–15
Laravel Rust: Laravel on Axum
laravel new blog --rust,laravel dev, routes and extractor-based handlers#[model]structs,create!, relationships and forward-only migrationsValid<T>validation,#[job]queues,#[schedule::tasks]and#[laravel::test]feature tests
Build: Port the same posts + comments + auth app to Laravel Rust.
- Week 16+
Ship and compare
- Multi-stage Docker builds and single-binary deploys
- Observability: structured logs, OpenTelemetry traces, Prometheus metrics
- Load-test the Laravel, Laravel Go and Laravel Rust versions and compare memory and p99
Build: Deploy all three versions and write up where each one fits your work.
Which one should I reach for?
Rules of thumb, not laws. Stay in Laravel unless a need pushes you out.
| Need | Pick | Why |
|---|---|---|
| CRUD-heavy SaaS or admin panel, shipped fast | Laravel | Eloquent, Filament, starter kits and first-party billing/auth: nothing in Go or Rust matches the speed of building CRUD. |
| Content site, marketing pages or a CMS | Laravel | Blade, Livewire and the ecosystem make content work cheap; raw speed rarely matters here. |
| Small automation inside an existing Laravel app | PHP | An Artisan command or queued job beats a new service, deploy pipeline and language. |
| High-concurrency JSON API or gateway | Go | Goroutines handle thousands of connections in little memory, and the stdlib HTTP server is production-ready. |
| A CLI you hand to other people | Go | One static binary, cross-compiled with two environment variables; no runtime to install. |
| Infrastructure tooling, Kubernetes operators | Go | Kubernetes, Docker and Terraform are written in Go, so client libraries and examples are first-class. |
| Realtime: many WebSocket connections | Go | Cheap goroutines per connection; use Laravel Reverb if you are already a Laravel shop. |
| A Laravel team that needs a compiled service | Laravel Go | Official Laravel on Go's net/http: the same laravel CLI, migrations, queues, scheduler and Inertia, so the team is productive in days. Beta until 1.0. |
| Laravel-style Go app that can't absorb breaking changes yet | Go | Use the community Goravel framework: Laravel Go is pre-1.0 and may change APIs between releases, while Goravel has a longer track record. |
| CPU-heavy hot path: parsing, image or video work | Rust | C-level speed without a garbage collector, with memory safety checked at compile time. |
| WebAssembly or edge functions | Rust | The best WASM toolchain and tiny binaries; runs in browsers, Cloudflare Workers and Fastly. |
| Embedded, systems or memory-constrained work | Rust | No runtime, predictable memory, and the safety guarantees matter most here. |
| Laravel-style productivity with Rust's guarantees | Laravel Rust | Official Laravel on Axum + Tokio: models, validation, queues, scheduling, mail and Inertia, checked at compile time. Beta until 1.0. |
| Rewriting a working Laravel monolith | Laravel | Don't. Profile first, then extract only the hot spot into a Go or Rust service behind an API or queue. |
Resources
Official docs, books, courses and playgrounds worth your time.
PHP Manual
Docs. The official language and function reference.
Supported PHP versions
Docs. Active support and security-fix dates for each release.
PHP: The Right Way
Book. Community guide to modern PHP practice.
PHP.Watch versions
Docs. What changed in every PHP release, feature by feature.
3v4l.org
Playground. Run a snippet on every PHP version at once.
PHPStan user guide
Docs. Static analysis: the closest PHP gets to a compiler.
Laravel documentation
Docs. Always points at the current release.
Laracasts
Course. Video courses on Laravel, PHP and more.
Laravel on YouTube
Course. Official channel: release walkthroughs and tutorials (laravel.com/learn points here).
Laravel News
Newsletter. Releases, packages and tutorials.
Spatie open source
Community. Hundreds of well-maintained Laravel packages.
A Tour of Go
Course. Interactive tour of the whole language.
Go documentation
Docs. Tutorials, guides and release notes.
Effective Go
Docs. How idiomatic Go is written.
The Go spec
Docs. Short, readable language specification.
Go by Example
Book. Annotated example programs for every feature.
Learn Go with Tests
Book. Learn the language test-first.
100 Go Mistakes
Book. Common mistakes and how to avoid them.
Go Playground
Playground. Run and share Go in the browser.
pkg.go.dev
Docs. Docs for the standard library and every public module.
Exercism Go track
Course. Free exercises with mentoring.
Golang Weekly
Newsletter. Weekly Go news and articles.
The Go Blog
Docs. Deep dives from the Go team.
Go Forum
Community. Ask questions, get answers.
The Rust Programming Language
Book. "The Book": start here.
Rust by Example
Book. Runnable examples for every concept.
Rustlings
Course. Small exercises to pair with the Book.
Comprehensive Rust
Course. Google's multi-day Rust course.
Standard library docs
Docs. Every type and trait in std.
The Cargo Book
Docs. Packages, workspaces, features, profiles.
docs.rs
Docs. Generated docs for every crate.
Asynchronous Programming in Rust
Book. Futures, async/await and executors.
Tokio tutorial
Course. Build a mini Redis while learning async Rust.
Zero To Production in Rust
Book. Building a production web API in Rust, end to end.
Rust API Guidelines
Docs. How to design idiomatic Rust APIs.
Rust Playground
Playground. Run, format and share Rust in the browser.
Exercism Rust track
Course. Free exercises with mentoring.
This Week in Rust
Newsletter. Weekly community newsletter.
Rust users forum
Community. Friendly help for learners.
Laravel Go documentation
Docs. Official guides for Laravel on Go (beta, v0.2).
Laravel Go installation
Docs. Needs Go 1.27+. Install the laravel CLI and create an app with laravel new --go.
go.laravel.com API reference
Docs. Package docs for every go.laravel.com package.
Laravel Go on GitHub
Community. Source, issues and releases.
Laravel Rust documentation
Docs. Official guides for Laravel on Rust (beta, v0.2).
Laravel Rust installation
Docs. Needs Rust 1.99+. Install the laravel CLI and create an app with laravel new --rust.
laravel-rust API reference
Docs. Generated docs for the laravel-rust crate.
Laravel Rust on GitHub
Community. Source, issues and releases; the guides live in docs/.
Axum docs
Docs. The web layer under Laravel Rust.
Goravel (community alternative)
Community. Community Laravel-style framework for Go.
Loco (community alternative)
Community. Community Rails/Laravel-style framework for Rust on Axum + SeaORM.