Skip to content
👫 📦 Laravel 5 Package for enabling facebook type of mentions in your application
JavaScript PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
resources Add Factories, Controllers and routes Sep 19, 2015
tests [laravel-mentions] Update namespace from Busayo to Unicodeveloper Nov 4, 2015
.travis.yml Add travis config file Sep 19, 2015 Initial Commit Sep 19, 2015 Update Jan 12, 2016
composer.json [laravel-mentions] Update namespace from Busayo to Unicodeveloper Nov 4, 2015
phpunit.xml.dist [laravel-mentions] Update namespace from Busayo to Unicodeveloper Nov 4, 2015


Latest Stable Version License Build Status Quality Score Total Downloads

This package makes it possible to create text/textarea fields that enable mentioning by using At.js.

The data for the autocomplete is loaded from a route which will load data based on predefined key-value pairs of an alias and a model in the config.


First, pull in the package through Composer.

"require": {
    "unicodeveloper/laravel-mentions": "1.1.*"

And then include these service providers within config/app.php.

'providers' => [

If you need to modify the configuration or the views, you can run:

php artisan vendor:publish

The package views will now be located in the app/resources/views/vendor/mentions/ directory and the configuration will be located at config/mentions.php.


To make it possible for At.js to load data we need to define key-value pairs that consist of an alias and a corresponding model.

return [

    'users'    => 'App\User',      // responds to /api/mentions/users
    'friends'  => 'App\Friend',    // responds to /api/mentions/friends
    'clients'  => 'App\Client',    // responds to /api/mentions/clients
    'supports' => 'App\Supporter', // responds to /api/mentions/supports


So now with these aliases configured we could create a new textfield which will send a request to the users route and search for matching data in the name column.

{!! mention()->asText('recipient', old('recipient'), 'users', 'name') !!}

You can also add a class name for styling of the text and textareas, that's the last argument. In this example, it is user-form

{!! mention()->asText('recipient', old('recipient'), 'users', 'name', 'user-form') !!}


<!doctype html>
<html lang="en">
        <meta charset="UTF-8">
        <title>Laravel PHP Framework</title>
        <link rel="stylesheet" type="text/css" href="/css/jquery.atwho.min.css">
         <!-- Requirements -->
        <script src="//"></script>
        <script src="/js/jquery.atwho.min.js"></script>
        <script src="/js/jquery.caret.min.js"></script>
        <!-- Laravel Mentions -->

        <div class="container">
            {!! mention()->asText('recipient', old('recipient'), 'users', 'name') !!}
            {!! mention()->asTextArea('message', old('message'), 'users', 'name') !!}
        </div><!-- /.container -->


Via Composer

$ composer require unicodeveloper/laravel-mentions

Change log

Please see CHANGELOG for more information what has changed recently.


$ composer test


Please see CONTRIBUTING for details.

How can I thank you?

Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!

Don't forget to follow me on twitter!

Thanks! Prosper Otemuyiwa.


The MIT License (MIT). Please see License File for more information.

You can’t perform that action at this time.