Config File

🛠️ Config File

The configuration file is provided by the Laravel Followable package.

You can publish this file to your application by following the instructions in the Installation section.

Here’s the configuration file:

<?php
 
declare(strict_types=1);
 
use Akira\Followable\Followable;
 
return [
 
    /*
    |--------------------------------------------------------------------------
    | UUIDs Primary Key
    |--------------------------------------------------------------------------
    |
    | If set to true, UUIDs will be used as the primary key for your models.
    | By default, it is set to false, meaning auto-incrementing integers are used.
    |
    */
    'uuids' => false,
 
    /*
    |--------------------------------------------------------------------------
    | User Foreign Key
    |--------------------------------------------------------------------------
    |
    | This is the name of the foreign key column in the followables table that
    | will reference the user model. By default, it is set to 'user_id'.
    |
    */
    'user_foreign_key' => 'user_id',
 
    /*
    |--------------------------------------------------------------------------
    | Followables Table Name
    |--------------------------------------------------------------------------
    |
    | This is the name of the table that will store the follower relationships.
    | The default value is 'followables', but you can change it to any name you prefer.
    |
    */
    'followables_table' => 'followables',
 
    /*
    |--------------------------------------------------------------------------
    | Followables Model Class
    |--------------------------------------------------------------------------
    |
    | This is the fully qualified class name for the followables model. By default,
    | it points to the \Overtrue\LaravelFollow\Followable model, but you can
    | change it to a custom model if needed.
    |
    */
    'followables_model' => Followable::class,
];
 

📝 Configuration Overview

The configuration file contains the following parameters:

  • UUIDs Primary Key: Set to false by default, this parameter determines whether UUIDs are used as the primary key for your models.

  • User Foreign Key: The name of the foreign key column in the followables table that references the user model. The default value is user_id.

  • Followables Table Name: The name of the table that stores the follower relationships. The default value is followables.

  • Followables Model Class: The fully qualified class name for the followables model. By default, it points to the Akira\Followable\Followable model.

🚀 Customizing the Configuration

With this configuration in place, your application is ready. You can modify the configuration settings to suit your specific needs.