Download the PHP package votong/laravel-mentions without Composer

On this page you can find all versions of the php package votong/laravel-mentions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-mentions

End-to-end Mentions in Laravel 5, 6, 7 & 8

Build Status

Abandoned

Unfortunately, I don't have the time to adequately maintain this package. I recommend Xetaravel-Mentions which appears to be better maintained with similar functionality.

In hindsight, this package has tried to do too much to implement this functionality. If you're looking to implement mentions, I think you'd be better off implementing the front-end manually, and abstracting the back-end to that package above or writing your own API.


Hope this helps!

This Laravel >=5.4 package provides an easy way to setup mentions for Eloquent models. It provides the front-end for inserting mentions into content-editable elements, the back-end for associating mentions with models and lastly an elegant way to notify the mentioned models that they have been mentioned.

Here are a few short examples of what you can do:

It handles notifications for you as well. If your mentions config has auto_notify enabled, it will do it for you. If you need to handle the logic yourself, disable auto_notify and explicitly notify the mention, for example:

Requirements

Installation

You can install this package via composer using this command:

If you're using Laravel 5.5 or greater this package will be auto-discovered, however if you're using anything lower than 5.5 you will need to register it the old way:

Next, you must install the service provider in config/app.php:

Now publish the migration, front-end assets and config:

After the migration has been published you can create the mentions table by running the migrations:

This is the contents of the published config file:

Usage

First you will need to import Tribute.

Then include Tribute in your bootstrap.js file and assign it globally.

Now in your bootstrap.js file you can import the Mentions class and also assign it globally.

Now to include the styling just import it into your SCSS file.

Now let's setup the form where we'll write a comment that has mentions:

Next add the script to initialize the mentions:

Now onto the back-end. Choose the model that you want to assign mentions to. In this example I'll choose Comments. We'll import the trait and use it in the class.

Next switch to the controller for where you store the comment. In this case it's CommentController. Create the comment however you like, and afterwards just call the mention method.

That's it! Now when displaying your comments you can style the .mention-node class that is inserted via Tribute. That same node also has a data-object attribute that contains the pool name and reference value, eg: users:1.

Editing Content With Mentions

You'll most likely need to edit the text content, so it's necessary to restore the mentions list in the form. It's as simple as this:

Then on the back-end you can update the model's mentions by doing the following:

Notifications

If you want to use notifications, here's some stuff you may need to know.

Filters

You might want to apply some custom filters to the model when it retrieves the records. To do this just create a class somewhere in your app, then add it to the mention config:

This is what your filter class should look like. It just has one static method called handle that takes the query as an argument, and must return the query.

Resources

If you'd like to change the JSON response that the /api/mentions route returns, you can create your own resource class. To begin with head over to the Laravel docs to create and setup a resource class.

Once you have your resource class, simply add it to your mention config in one or more of your pools, such as:

Middleware

If you'd like you can optionally add middleware to the /api/mentions route. This can be useful in case you want to protect the route behind an authentication guard. Head over to the Laravel docs find out more about middleware.


All versions of laravel-mentions with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
illuminate/support Version ^5.5|^6.0|^7.0|^8.0
illuminate/database Version ^5.5|^6.0|^7.0|^8.0
illuminate/http Version ^5.5|^6.0|^7.0|^8.0
illuminate/routing Version ^5.5|^6.0|^7.0|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package votong/laravel-mentions contains the following files

Loading the files please wait ....