GoravelGoravel
Home
Video
  • English
  • 简体中文
GitHub
Home
Video
  • English
  • 简体中文
GitHub
  • Prologue

    • Upgrade Guide

      • Upgrading To v1.15 From v1.14
      • Upgrading To v1.14 From v1.13
      • History Upgrade
    • Contribution Guide
    • Excellent Extend Packages
  • Getting Started

    • Installation
    • Configuration
    • Directory Structure
    • Compile
  • Architecture Concepts

    • Request Lifecycle
    • Service Container
    • Service Providers
    • Facades
  • The Basics

    • Routing
    • HTTP Middleware
    • Controllers
    • Requests
    • Responses
    • Views
    • Grpc
    • Session
    • Validation
    • Logging
  • Digging Deeper

    • Artisan Console
    • Cache
    • Events
    • File Storage
    • Mail
    • Queues
    • Task Scheduling
    • Localization
    • Package Development
    • Color
    • Strings
    • Helpers
  • Security

    • Authentication
    • Authorization
    • Encryption
    • Hashing
  • ORM

    • Getting Started
    • Relationships
    • Migrations
    • Seeding
    • Factories
  • Testing

    • Getting Started
    • HTTP Tests
    • Mock

Service Providers

  • Introduction

Introduction

The most important thing in the kernel boot operation is to load the ServiceProvider. All ServiceProvider under the application are configured in the providers array in config/app.go.

First, the kernel will call the Register method of all service providers. After all service providers have been registered, the kernel will call the Boot method of all ServiceProvider again.

The ServiceProvider is the key to the life cycle of Goravel. They enable the framework to contain various components, such as routing, database, queue, cache, etc.

You can also customize your own provider, it can be stored under app/providers and registered in the providers array in config/app.go.

The framework comes with a blank service provider app/providers/app_service_provider.go where you can implement simple boot logic. In bigger projects, you have the option to create new service providers for more precise control.

Edit this page
Prev
Service Container
Next
Facades