The same Laravel ideas in three languages: PHP, Rust, and Go
Published December 2, 2026 · by Majd Ghithan, written with the help of AI
The fastest way to understand a framework is to look at code you already know written in it. So instead of another feature list, this article puts the same Laravel concepts next to each other in three places: Laravel PHP, the new Laravel Rust beta, and Goravel.
A quick note on sources before the code. The Laravel Rust and Goravel snippets are copied from their official docs. The PHP snippets are standard Laravel that you have probably written a hundred times. And a reminder: Goravel is an independent community project "in tribute to Laravel", not a Laravel product, while Laravel Rust is from Taylor Otwell and the Laravel team.
1. Starting a project
Laravel PHP, the way most of us start:
laravel new example-app
Laravel Rust uses the same command with a flag:
laravel new example-app --rust
Goravel has its own installer:
go install github.com/goravel/installer/goravel@latest
goravel new blog
Already a small difference worth knowing: Laravel Rust needs Rust 1.99 or later, and a new app comes with Inertia, React, TypeScript, Tailwind and Vite Plus, defaulting to PostgreSQL. Goravel needs Go 1.25 or later and asks whether you want the full framework or "Goravel Lite with only the essential facades".
2. A route
Here is a route with route model binding in Laravel PHP:
use App\Models\User;
use Illuminate\Support\Facades\Route;
Route::get('/users/{user}', fn (User $user) => $user->name);
And the same idea in Laravel Rust, from its routing docs:
use crate::models::User;
pub fn routes(route: &mut Router) {
route.get("/users/{user}", async |user: User| user.name);
}
This is the closest match in the whole article. Same path syntax, same binding: the docs say a closure that takes a User "receives the user whose ID is in the URI", and you get a 404 when no user has that ID. The main differences are the async closure and the fact that routes live in a function that receives a Router.
Goravel's routing docs show a JSON response rather than model binding, so here is that one with a PHP equivalent:
facades.Route().Get("/", func(ctx http.Context) http.Response {
return ctx.Response().Json(http.StatusOK, http.Json{
"Hello": "Goravel",
})
})
Route::get('/', fn () => response()->json(['Hello' => 'Laravel']));
The facade is there (facades.Route() instead of Route::), but Go makes everything explicit: the context, the status code, the return type. Under the hood Goravel uses gin by default, with fiber as the other supported HTTP driver.
3. A model
Laravel PHP, with two relationships:
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Post extends Model
{
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function comments(): HasMany
{
return $this->hasMany(Comment::class);
}
}
Laravel Rust, trimmed from the relationships docs:
#[model]
pub struct Post {
pub id: i64,
pub user_id: i64,
pub title: String,
#[default]
pub votes: i64,
pub published_at: Option<Timestamp>,
pub created_at: Timestamp,
pub updated_at: Timestamp,
#[belongs_to]
pub user: BelongsTo<User>,
#[has_many]
pub comments: HasMany<Comment>,
}
The biggest mental shift is here. In Eloquent, columns are not declared on the class; they come from the database at runtime. In Laravel Rust every column is a typed field, so "comparing Post::votes against a string fails at compile time rather than failing at runtime." Relationships become fields too.
Goravel, from its ORM docs, with soft deletes:
type User struct {
orm.Model
Name string
Avatar string
orm.SoftDeletes
}
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class User extends Model
{
use SoftDeletes;
}
Like Laravel Rust, Goravel declares fields on a struct. orm.SoftDeletes is embedded where PHP would use a trait. The ORM itself sits on top of GORM.
4. A query
Finding one record, as shown on Goravel's comparison page:
User::find(1);
facades.Orm().Query().Find(&user, 1)
Eager loading in Laravel PHP and Laravel Rust:
$posts = Post::with('user')->get();
let posts = Post::query().with(Post::user).get().await?;
Notice the Rust version uses Post::user, not the string 'user', so a typo cannot compile. And here is the rule every Laravel developer should learn before touching Laravel Rust:
Coming from PHP, where a forgotten with() silently becomes an N+1, I find this stricter behaviour easier to reason about. But it is still a runtime failure, and your tests need to cover it.
5. Migrations and the CLI
php artisan migrate
laravel migrate
./artisan migrate
Goravel kept the name Artisan. Laravel Rust moved app commands to the laravel CLI. One deeper difference: in Laravel Rust "your migrations compile into the binary", and a build.rs file rebuilds the app when you add one. Goravel also deploys as a single binary. In PHP, migrations stay as files you run on the server.
What carries over, and what does not
Carries over: the vocabulary (routes, models, migrations, Artisan or an Artisan-like CLI, queues, policies), the folder thinking, eager loading as a habit, and the idea that the framework should give you batteries, not just a router.
Does not carry over:
- The type system. Eloquent's runtime magic becomes declared, typed fields in both Rust and Go.
- Async. Laravel Rust is built on Axum and Tokio and is fully asynchronous, so
.awaitis everywhere. - Build time. Laravel's own benchmark measured a median cold build on Cloud of about 3 minutes for Laravel Rust against 27 seconds for Laravel PHP.
- The ecosystem. Goravel's own comparison lists Notifications, Broadcasting and Livewire as "Not yet". Laravel Rust is "near feature parity" with gaps still being closed during beta.
My take
Writing these side by side, what struck me is how much of Laravel is a way of thinking rather than a set of PHP functions. Taylor put it as "Programming languages are an implementation detail of that philosophy," and these snippets mostly prove him right. I have not shipped Rust or Go in production, so I will not tell you either is easy. But if you know Laravel PHP well, you already understand what each line above is trying to do. The real learning is the language around it: types, ownership in Rust, explicit errors in Go. Learn that part properly, and the framework will feel like home.
