PHP code example of russofinn / laravel-interactions

1. Go to this page and download the library: Download russofinn/laravel-interactions library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

russofinn / laravel-interactions example snippets


interactions()->comment('Look, I said something.');

return [
    /*
     * You can specify an auth driver here that gets user models.
     * If this is null we'll use the default Laravel auth driver.
     */
    'default_auth_driver' => null,
    /*
     * If set to true, the subject returns soft deleted models.
     */
    'subject_returns_soft_deleted_models' => false,

    'mentions' => [
        /*
         * If set to true, the subject returns soft deleted models.
         */
        'character' => '@',
        'regex' => '/\s({character}{pattern}{rules})/',
        'regex_replacement' => [
            '{character}' => '@',
            '{pattern}' => '[A-Za-z0-9]',
            '{rules}' => '{4,20}'
        ],

        /*
         * Model that will be mentioned.
         */
        'model' => 'App\User',

        /*
         * The column that will be used to search the model by the parser.
         */
        'column' => 'username',

        /*
         * The route used to generate the user link when mention
         */
        'route' => '/users/profile/@'
    ],

    /*
     * This model will be used to log activity. The only the table that will be created by the migration and
     * used by the View model shipped with this package.
     */
    'table_name_mentions' => 'mentions'

    /*
     * This is the name of the table that will be created by the migration and
     * used by the Like model shipped with this package.
     */
    'table_name_likes' => 'likes',

    /*
     * This is the name of the table that will be created by the migration and
     * used by the View model shipped with this package.
     */
    'table_name_views' => 'views'
];

bash
php artisan vendor:publish --provider="Russofinn\Interactions\InteractionsServiceProvider" --tag="migrations"
bash
php artisan migrate
bash
php artisan vendor:publish --provider="Russofinn\Interactions\InteractionsServiceProvider" --tag="config"