Skip to content

Commit

Permalink
feat: create docs to change the default interaction model
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Oct 26, 2024
1 parent 83b219f commit 95eb14c
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
17 changes: 17 additions & 0 deletions sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,23 @@ module.exports = {
],
collapsed: false,
},
{
type: 'category',
link: {
type: 'generated-index',
title: 'Usage - Laravel Like Package',
description: 'This section will guide you on how to use the Laravel Like Package. Let\'s get started with your first interaction in Laravel project!',
},
label: 'Usage',
items: [
{
type: 'doc',
id: 'usage/change_default_interaction',
label: '🔄 Change Default Interaction',
},
],
collapsed: false,
},
{
type: 'category',
link: {
Expand Down
45 changes: 45 additions & 0 deletions usage/change_default_interaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
title: Change the default interaction model | Laravel Like
description: Change the default interaction model for Laravel Like package. Change the default interaction model for Laravel Like package to customize the interactions as per your requirements.
keywords: ['laravel like', 'change default interaction model', 'interaction model', 'default interaction model', 'customize interactions', 'Laravel Like interaction model']
tags: ['Change Default Interaction Model', 'Interaction Model', 'Customize Interactions', 'Laravel Like Interaction Model', 'Laravel Like Package', 'Update Interaction Model', 'Usage', 'Laravel Like Usage']
---

<head>
<meta name="robots" content="index,follow" />
<meta name="author" content="CSlant" />
</head>

# 🛠 Change Default Interaction Model

Here is the default interaction model for Laravel Like package. You can customize the interaction model as per your requirements.

Path: `config/like.php`

```php
'interaction_model' => \CSlant\LaravelLike\Models\Like::class,
```

Sometimes, you may want to change the default interaction model to customize the interactions as per your requirements. You can change the default interaction model by updating the `interaction_model` key in the `config/like.php` file.

**Here is how you can change the default interaction model:**

```php
'interaction_model' => \App\Models\CustomInteraction::class,
```

And in the `CustomInteraction` model, you need to extend the `CSlant\LaravelLike\Models\Like` model.

```php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use CSlant\LaravelLike\Models\Like;

class CustomInteraction extends Like
{
// Define your custom interactions here
}
```

In the above example, we have changed the default interaction model to `CustomInteraction` model. You can replace `CustomInteraction` with your custom interaction model.

0 comments on commit 95eb14c

Please sign in to comment.