> For the complete documentation index, see [llms.txt](https://docs.opensoutheners.com/oss/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opensoutheners.com/oss/laravel-user-interactions/getting-started.md).

# Getting started

Integrate user interactions to your Laravel application like: followers, subscribers, likes, participants, etc

First install it using Composer:

```bash
composer require open-southeners/laravel-user-interactions
```

Then publish the **required** database migrations and config file:

```bash
php artisan vendor:publish --provider="OpenSoutheners\\LaravelUserInteractions\\ServiceProvider"
```

Run the migrations and you're almost all setup, now you need to **configure the interactable models** to be able to query and perform interactions from and into these models.

For example for your User model:

<pre class="language-php"><code class="lang-php">&#x3C;?php

namespace App\Models;

use Illuminate\Foundation\Auth\User as Authenticatable;
use OpenSoutheners\LaravelUserInteractions\Concerns\InteractsWith;
use OpenSoutheners\LaravelUserInteractions\Contracts\Interactable;

class User extends Authenticatable <a data-footnote-ref href="#user-content-fn-1">implements Interactable</a>
{
    <a data-footnote-ref href="#user-content-fn-2">use InteractsWith</a>;
    
    // The rest of your code here...
}
</code></pre>

And the models where your users will interact into:

```php
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use OpenSoutheners\LaravelUserInteractions\Concerns\InteractsWith;
use OpenSoutheners\LaravelUserInteractions\Contracts\Interactable;

class Post extends Model implements Interactable
{
    use InteractsWith;

    // The rest of your code here...
}

```

And you are all set! 🎉

[^1]: Add this interface to the model to be able to use the model within the package functionality

[^2]: Also don't forget the trait that will make the actual functionality (relationships) work


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.opensoutheners.com/oss/laravel-user-interactions/getting-started.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
