PHPackages                             crixuamg/laravel-mentions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. crixuamg/laravel-mentions

ActiveLibrary

crixuamg/laravel-mentions
=========================

A package to parse a @mention from a text and mention the user with a notification.

4.0.3(4y ago)85.5k1[1 PRs](https://github.com/CrixuAMG/Laravel-Mentions/pulls)MITPHP

Since May 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/CrixuAMG/Laravel-Mentions)[ Packagist](https://packagist.org/packages/crixuamg/laravel-mentions)[ Docs](https://github.com/CrixuAMG/Laravel-Mentions)[ RSS](/packages/crixuamg-laravel-mentions/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)Dependencies (15)Versions (17)Used By (0)

> # Laravel Mentions
>
> [](#laravel-mentions)
>
> TravisCoverageStable VersionDownloadsLaravelLicense[![Build Status](https://camo.githubusercontent.com/d25f11f655a19b4ee23dce3d2d25f344b437db15a5621061ec35e11ddf2e41f9/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4372697875414d472f4c61726176656c2d4d656e74696f6e732e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/CrixuAMG/Laravel-Mentions)[![Coverage Status](https://camo.githubusercontent.com/279546a08fbec8530682a5c04dbb7a36c159ed6870debdde53403660d99bcf62/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f4372697875414d472f4c61726176656c2d4d656e74696f6e732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/CrixuAMG/Laravel-Mentions)[![Latest Stable Version](https://camo.githubusercontent.com/99e96c2d3cf26f04cd96bfdc1a9664fc199fb7e5b5cac6008244d19ed5a4e593/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4372697875414d472f4c61726176656c2d4d656e74696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/CrixuAMG/Laravel-mentions)[![Total Downloads](https://camo.githubusercontent.com/1b7f12c875eb299b16dd76726b7daab6a7827daba5f7726ead1bfd102a6549de/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f4372697875414d472f4c61726176656c2d6d656e74696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/CrixuAMG/Laravel-mentions)[![Laravel 5.6](https://camo.githubusercontent.com/89c502b6844dbd2c66504654c78b96c721b69c09032af6d2811bb036811d8527/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d2533453d352e362d6634363435662e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)[![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/CrixuAMG/Laravel-Mentions/blob/master/LICENSE)A package to parse `@mentions` from a text and mention the user with a notification.
>
> **By default** this package is configured to parse any text type and it will replace any matched `@mention` with a markdown link (`[@Mention](/users/profile/@Mention)`) if the mentionned user exist in the database. It will also send a notification with the Laravel `Notifiable` trait to all mentionned users. (Inspired from the [laravel-mentions](https://github.com/jameslkingsley/laravel-mentions) package.)
>
> Quick example :
>
> **Input** text :
>
> ```
>   Lorem ipsu @admin crepu @Member quis nostrud @UserDoesNotExist ullamcorper fail@mention nostrud @admin.
> ```
>
>
>
> **Output** text :
>
> ```
> Lorem ipsu [@Admin](/users/profile/@Admin) crepu [@Member](/users/profile/@Member) quis nostrud
> @UserDoesNotExist ullamcorper fail@mention nostrud [@Admin](/users/profile/@Admin).
> ```
>
>
>
> **And** Both `Admin` and `Member` users will be notified. **But** `Admin` will be notified only **one** time. (Yes the Parser include an anti-spam rule.)
>
> ## Table of Contents
>
> [](#table-of-contents)
>
> - [Requirement](#requirement)
> - [Installation](#installation)
>     - [ServiceProviders](#serviceproviders)
>     - [Vendor Publish](#vendor-publish)
>     - [Configuration](#configuration)
> - [Usage](#usage)
>     - [Parser configuration](#parser-configuration)
>     - [Parser configuration methods](#parser-configuration-methods)
> - [Custom Parser](#custom-parser)
> - [Notification](#notification)
> - [Contribute](#contribute)
>
> ## Requirement
>
> [](#requirement)
>
> [![PHP](https://camo.githubusercontent.com/109e6d78befbc92552e854d90263c1bb80c2c70066f596a9766bc5b5f87ee1a9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d2533453d372e312d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/109e6d78befbc92552e854d90263c1bb80c2c70066f596a9766bc5b5f87ee1a9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d2533453d372e312d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)
>
> ## Installation
>
> [](#installation)
>
> ```
> composer require CrixuAMG/Laravel-mentions
>
> ```
>
>
>
> #### ServiceProviders
>
> [](#serviceproviders)
>
> Import the `MentionServiceProvider` in your `config/app.php`:
>
> ```
> 'providers' => [
>   //...
>   CrixuAMG\Mentions\Providers\MentionServiceProvider::class,
>   //...
> ]
> ```
>
>
>
> #### Vendor Publish
>
> [](#vendor-publish)
>
> Publish the vendor files to your application (included the config file `config/mentions.php` and the migration file) :
>
> ```
> php artisan vendor:publish --provider="CrixuAMG\Mentions\Providers\MentionServiceProvider"
> ```
>
>
>
> Then migrate the database :
>
> ```
> php artisan migrate
> ```
>
>
>
> #### Configuration
>
> [](#configuration)
>
> ```
>
