Goravel Framework

website·Indexed 32 days ago

https://www.goravel.dev

A Go framework providing a Laravel-inspired development experience. It features a comprehensive suite of tools including an ORM with model relationships and factories, a fluent string and collection API, an Artisan command-line tool, and a unified AI SDK. The framework supports HTTP middleware, service providers, facades, and a robust testing environment with HTTP tests and mocking capabilities.

Tokens
194.2K
Snippets
1.3K
Records
1.5K
Agent score
67%

What's inside Goravel

  1. Overview of Goravel Lazy Collection methods

    Goravel provides a set of Lazy Collection methods categorized by their execution behavior: Pipeline methods (which are lazy and return a new collection for chaining) and Terminal methods (which execute the pipeline and return a final value).
    // Creation Methods
    LazyNew, LazyOf, LazyRange, LazyGenerate, LazyFromFunc, LazyFromChannel, LazyRepeat
    
    // Pipeline Methods (Chainable)
    Filter, Reject, Map, FlatMap, Where, WhereIn, WhereNotIn, Take, Skip, TakeWhile, SkipWhile, Unique, UniqueBy, Sort
    
    // Terminal Methods (Execution)
    All, Count, First, FirstWhere, Last, Contains, Every, IsEmpty, IsNotEmpty, Collect, Sum, Avg, Min, Max, ToJson, Iterator
    
    // Generic Methods
    LazyMap, LazyReduce
  2. Overview of Goravel Cache System

    Goravel provides an extensible caching module accessible via facades.Cache(). The framework includes a built-in memory driver. For other drivers, such as Redis, separate extension packages must be installed.
    # Redis driver extension
    # https://github.com/goravel/redis
  3. Overview of the Goravel Service Container

    The Goravel Service Container is a powerful tool used for managing class dependencies and implementing dependency injection. It contains all framework modules and allows developers to bind their own services to the container for resolution when needed. It also provides essential support for third-party packages within the Goravel ecosystem.
  4. Overview of Goravel Collections

    Goravel provides a fluent API for filtering, transforming, aggregating, and inspecting slice data via the github.com/goravel/framework/support/collect package. It offers two primary collection types:

    1. Collection: An eager collection used for data already loaded into memory.
    2. LazyCollection: A lazy collection that only executes the pipeline when a terminal method (e.g., All, Count, First) is called, making it ideal for large datasets or generators.
    import "github.com/goravel/framework/support/collect"
  5. Overview of Goravel Queues

    Goravel provides a queue system to move time-intensive tasks (like parsing CSV files) to the background, allowing web requests to respond faster. The system is accessed via the facades.Queue() facade. It distinguishes between 'connections' (the backend service, e.g., Redis) and 'queues' (specific stacks of jobs within a connection). Each connection has a default queue defined in config/queue.go.
  6. Overview of gRPC in Goravel

    Goravel provides a built-in gRPC module that allows developers to build and consume gRPC services for both server and client sides. The module is operated via the facades.Grpc() facade.
  7. Overview of Goravel Queue System

    Goravel provides a queue system to handle time-consuming tasks (like CSV processing) in the background, improving web response times. It is accessed via the facades.Queue() facade.

    Key concepts:

    • Connections: Defined in config/queue.go, these represent the backend service (e.g., Redis).
    • Queues: Individual stacks of tasks within a connection. Each connection has a default queue defined in its configuration; if no specific queue is requested during dispatch, the task goes to this default.
  8. Overview of Goravel Filesystem Drivers

    Goravel provides a unified API for interacting with various storage backends. The local driver is included by default. For other cloud providers, separate extension packages must be installed: S3, Aliyun OSS, Tencent COS, Minio, and Cloudinary. Because the API remains consistent across drivers, switching storage backends requires minimal code changes.
  9. Overview of Goravel Lite

    v1.17.html
    Goravel Lite is a lightweight version of the framework designed for minimal dependencies. It only includes essential facades (Artisan, Config) by default. Other facades can be added or removed using package:install and package:uninstall commands. The standard goravel/goravel repository remains the primary distribution and is essentially goravel-lite plus all facades.
  10. Overview of Goravel File Storage Drivers

    Goravel provides a unified API for interacting with various filesystems, allowing developers to switch between local development and production storage without changing code. The local driver is included by default. Other drivers are available as independent extension packages:
  11. Overview of Goravel Event System

    Goravel implements the observer pattern via its event system, allowing developers to decouple different parts of an application. Events are typically stored in app/events and listeners in app/listeners. A single event can trigger multiple unrelated listeners (e.g., triggering an OrderShipped event to send both a Slack notification and an email).
  12. Overview of Goravel Lite

    v1.17.html
    Goravel Lite is a lightweight version of the framework designed for minimal dependencies and smaller footprints. It includes only essential facades (Artisan, Config, Process). Other facades can be added or removed on-demand using the package:install and package:uninstall commands.