Skip to content
Goravel/ Docs
Docs/Prologue/Compare With Laravel

Compare With Laravel ​

Goravel follows the structure of Laravel, so the concepts, the facades and most method names carry over. The table below shows the same task in both frameworks. Where one of them does not have a feature, it says so.

Feature Laravel Goravel
Artisan Consolephp artisan key:generate./artisan key:generate
AuthenticationAuth::login($user)facades.Auth(ctx).Login(&user)
AuthorizationGate::allows('update-post', $post)facades.Gate().Allows("update-post", map[string]any{"post": post})
CacheCache::put('key', 'value', 60)facades.Cache().Put("key", "value", time.Minute)
CarbonCarbon::now()->addDays(1)carbon.Now().AddDays(1)
Configconfig('app.name')facades.Config().GetString("app.name")
CryptCrypt::encryptString('text')facades.Crypt().EncryptString("text")
DBDB::table('users')->get()facades.DB().Table("users").Get(&users)
EventOrderShipped::dispatch()facades.Event().Job(&events.OrderShipped{}, []event.Arg{}).Dispatch()
FactoryUser::factory()->make()facades.Orm().Factory().Make(&user)
File StorageStorage::put('file.txt', 'content')facades.Storage().Put("file.txt", "content")
HashHash::make('password')facades.Hash().Make("password")
HTTP ClientHttp::get('https://example.com')facades.Http().Get("https://example.com")
Localization__('messages.welcome')facades.Lang(ctx).Get("messages.welcome")
LoggingLog::info('message')facades.Log().Info("message")
MailMail::to('user@example.com')->send(new OrderShipped())facades.Mail().To([]string{"user@example.com"}).Send()
Migrationsphp artisan migrate./artisan migrate
MockCache::shouldReceive('get')mock.Factory().Cache()
ORMUser::find(1)facades.Orm().Query().Find(&user, 1)
Package Development$this->loadViewsFrom($path, 'courier')facades.View().LoadViewsFrom("/path/to/package/views")
ProcessProcess::run('ls -la')facades.Process().Run("ls", "-la")
QueueSendEmail::dispatch()facades.Queue().Job(&jobs.SendEmail{}, []queue.Arg{}).Dispatch()
Rate LimitingRateLimiter::for('global', ...)facades.RateLimiter().For("global", ...)
RoutingRoute::get('/', [Controller::class, 'index'])facades.Route().Get("/", controller.Index)
Seeder$this->call([UserSeeder::class])facades.Seeder().Call([]seeder.Seeder{&UserSeeder{}})
Sessionsession(['key' => 'value'])ctx.Request().Session().Put("key", "value")
Task SchedulingSchedule::command('emails:send')->daily()facades.Schedule().Command("emails:send").Daily()
Testing$this->get('/tasks')s.Http(s.T()).Get("/tasks")
Validation$request->validate([...])ctx.Request().ValidateRequest(&storePost)
Viewview('welcome')ctx.Response().View().Make("welcome.tmpl")
Grpc Not built infacades.Grpc().Connect("user")
Telemetry Not built infacades.Telemetry().Tracer("app").Start(ctx, "order.process")
Notifications$user->notify(new InvoicePaid()) Not yet
Broadcastingbroadcast(new OrderShipped($order)) Not yet
Livewire<livewire:counter /> Not yet

Released under the MIT License