PHP code example of dongm2ez / larvel-mention

1. Go to this page and download the library: Download dongm2ez/larvel-mention 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/ */

    

dongm2ez / larvel-mention example snippets


  'providers' => [
      // Other service providers...
      Dongm2ez\Mention\MentionServiceProvider::class,
  ],
  

 

return [
    // They contain the model that will be mentioned
    'users' => [
        // Model that will be mentioned
        'model' => 'App\User',

        // The column that will be used to search the model
        'column' => 'name',
    ],

    // Match the front mentioned info
    'regex' => '/(\S*)\@([^\r\n\s]*)/i',

    // laravel route alias
    'route_name' => 'users.show',

    // output format "html", "Markdown"
    'format' => 'html',

];

 


$parseText = Mention::parse("@david @Aaron @Judy @麦索 Balabalabala...");