> For the complete documentation index, see [llms.txt](https://docs.opensoutheners.com/home/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/home/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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
