PHPackages                             devzkhalil/laravel-trovit-xml-feed - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. devzkhalil/laravel-trovit-xml-feed

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

devzkhalil/laravel-trovit-xml-feed
==================================

Laravel Trovit XML Feed Generator is a package designed to help you easily create XML feeds for Trovit from your Laravel application's data.

1.x-dev(1y ago)42MITPHP

Since Jun 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/devzkhalil/laravel-trovit-xml-feed)[ Packagist](https://packagist.org/packages/devzkhalil/laravel-trovit-xml-feed)[ RSS](/packages/devzkhalil-laravel-trovit-xml-feed/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (1)DependenciesVersions (1)Used By (0)

Laravel Trovit XML Feed Generator
=================================

[](#laravel-trovit-xml-feed-generator)

Laravel Trovit XML Feed Generator is a package designed to help you easily create XML feeds for Trovit from your Laravel application's data.

What is Trovit?
---------------

[](#what-is-trovit)

[Trovit](https://help.trovit.com/hc/en-gb/articles/212152605-What-exactly-is-Trovit) is a popular online classifieds search engine that allows users to search for real estate, jobs, cars, and other classified ads in various categories. It aggregates listings from thousands of websites across the globe, making it a convenient platform for users to find what they're looking for.

Installation
============

[](#installation)

1.**Install the package via Composer:**

```
composer require devzkhalil/laravel-trovit-xml-feed:@dev
```

2.**Publish the configuration file:**

After installing the package, publish the configuration file using the command:

```
php artisan vendor:publish --provider="Devzkhalil\TrovitXmlFeed\TrovitXmlFeedServiceProvider"
```

This will create a **config/trovit.php** file where you can customize the fields and field mappings for your Trovit XML feed.

3.**Configuration:**

In the **config/trovit.php** file, define the fields and field mappings. The default configuration includes mandatory fields and other optional fields as per Trovit's specifications:

```
return [
    /*
    |--------------------------------------------------------------------------
    | Trovit XML Feed Format Fields
    |--------------------------------------------------------------------------
    | Here is the list of fields obtained from
    | https://help.thribee.com/hc/en-us/articles/7920567396124-UK-Jobs-feed
    |
    |--------------------------------------------------------------------------
    | Mandatory Fields
    |--------------------------------------------------------------------------
    | id
    | url
    | title
    | content
    |
    | Other fields are optional.
    | You can comment out fields if you don't need them.
    |
    */
    'fields' => [
        'id',
        'title',
        'url',
        'content',
        'city',
        'city_area',
        'region',
        'postcode',
        'salary',
        'working_hours',
        'company',
        'experience',
        'requirements',
        'contract',
        'category',
        'date',
        'studies'
    ],

    'field_mapping' => [
        // Example mapping: 'model_column_name' => 'trovit_field'
        'id' => 'id',
        'post_url' => 'url',
        'title' => 'title',
        'content' => 'content',
        // Add more mappings as needed
    ]
];
```

Basic Usage
===========

[](#basic-usage)

1.**Generate XML Feed:**To generate a Trovit XML feed, fetch the data from your model and call the **generate** method on the **TrovitXmlFeed** class. Here's an example using a **Post** model:

```
use App\Models\Post;
use Devzkhalil\TrovitXmlFeed\Facades\TrovitXmlFeed;

public function generateTrovitFeed()
{
    $posts = Post::latest()->select(['id', 'title', 'post_url', 'content'])->take(100)->get();

    $feed = TrovitXmlFeed::generate($posts, 'trovit-feed');

    if ($feed['status']) {
        return response()->json(['message' => 'Feed generated successfully'], 200);
    } else {
        return response()->json(['message' => $feed['message']], 500);
    }
}
```

This code snippet fetches the latest 100 posts from the **posts** table, generates an XML feed named **trovit-feed.xml**, and saves it to the **public** directory.

2.**Access the Generated Feed:**

The generated XML feed will be saved in the **public** directory of your Laravel application. You can access it via a URL like ****.

Example Controller Method
=========================

[](#example-controller-method)

Here's a complete example of a controller method that generates the Trovit XML feed:

```
namespace App\Http\Controllers;

use App\Models\Post;
use Illuminate\Http\JsonResponse;
use Devzkhalil\TrovitXmlFeed\Facades\TrovitXmlFeed;

class FeedController extends Controller
{
    /**
     * Generate Trovit XML Feed.
     *
     * @return JsonResponse
     */
    public function generateTrovitFeed(): JsonResponse
    {
        $posts = Post::latest()->select(['id', 'title', 'post_url', 'content'])->take(100)->get();

        $feed = TrovitXmlFeed::generate($posts, 'trovit-feed');

        if ($feed['status']) {
            return response()->json(['message' => 'Feed generated successfully'], 200);
        } else {
            return response()->json(['message' => $feed['message']], 500);
        }
    }
}
```

Summary
=======

[](#summary)

With **Laravel Trovit XML Feed Generator**, you can easily create and manage XML feeds for Trovit, ensuring your listings are always up-to-date and accessible. This package handles the heavy lifting, allowing you to focus on your core application logic.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

710d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a9f85d0c71f3a4355b7d680a3f082aa53a0d868c5a4c5069a095d9842584b3d8?d=identicon)[devzkhalil](/maintainers/devzkhalil)

---

Top Contributors

[![devzkhalil](https://avatars.githubusercontent.com/u/70958192?v=4)](https://github.com/devzkhalil "devzkhalil (4 commits)")

---

Tags

laravel-trovit-xml-feedlaravel-trovit-xml-feed-generatorphp-trovit-xml-feed-generatortrovittrovit-xml-feedxml-feedXML feedtrovittrovit-xml-feedlaravel-trovit-xml-feed-generatorlaravel-trovit-xml-feedphp-trovit-xml-feed-generator

### Embed Badge

![Health badge](/badges/devzkhalil-laravel-trovit-xml-feed/health.svg)

```
[![Health](https://phpackages.com/badges/devzkhalil-laravel-trovit-xml-feed/health.svg)](https://phpackages.com/packages/devzkhalil-laravel-trovit-xml-feed)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
