Installation and setup | laravel-feed-go | Spatie       

 SPATIE  

laravel-feed-go
===============

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-feed-go](https://spatie.be/docs/laravel-feed-go/v1)  Installation and setup

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/laravel-feed-go/v1) 

  Installation and setup    
- [ Introduction ](https://spatie.be/docs/laravel-feed-go/v1/introduction)
- [ Installation and setup ](https://spatie.be/docs/laravel-feed-go/v1/installation-and-setup)
- [ Usage ](https://spatie.be/docs/laravel-feed-go/v1/usage)
- [ HTTP integration ](https://spatie.be/docs/laravel-feed-go/v1/http)
- [ Customization ](https://spatie.be/docs/laravel-feed-go/v1/customization)
- [ Testing ](https://spatie.be/docs/laravel-feed-go/v1/testing)
- [ Releasing ](https://spatie.be/docs/laravel-feed-go/v1/releasing)
- [ Changelog ](https://spatie.be/docs/laravel-feed-go/v1/changelog)
- [ Support us ](https://spatie.be/docs/laravel-feed-go/v1/support-us)

 Installation and setup
======================

Requires Go 1.27 or newer and Laravel Go `go.laravel.com v0.1.0`.

```
go get github.com/spatie/laravel-feed-go@v0.1.0
```

During development, run `go work init . ../laravel-feed-go` from a neighboring application. Do not commit a local `replace` directive.

Add the package to `Packages` in `bootstrap/app.go`. Installing the Go module alone does not activate its routes or template helper.

```
feed.New(func(cfg *feed.Config) {
    cfg.Prefix = "/syndication"
    cfg.Feeds = []feed.Definition{{
        Name: "news",
        Path: "/news",
        Feed: feed.Feed{
            Title: "My feed",
            Description: "The description of the feed.",
            Language: "en-US",
            Format: feed.Atom,
        },
        Items: getFeedItems,
    }}
})
```

`getFeedItems` is your `func(context.Context) ([]feed.Item, error)`. It can query any model or repository. The resulting route is `/syndication/news`, named `feeds.news`. Add several definitions for several feeds.

`FEED_PREFIX` supplies a default for `cfg.Prefix`. Explicit callbacks run afterward. Registration is repeatable and each application gets its own definitions. Finish configuration before serving requests, and do not mutate shared slices or captured state concurrently.

There is no `feed:install` command or configuration file to publish. Laravel's native registrar installs routes and template functions. No package-tools dependency, database or external binary is needed.

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
