Download the PHP package xetaio/xetaravel-mentions without Composer

On this page you can find all versions of the php package xetaio/xetaravel-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 xetaravel-mentions

Xetaravel Mentions

Unit Tests Coverage Stable Version Downloads Laravel License
GitHub Workflow Status Coverage Status Latest Stable Version Total Downloads Laravel 10.0 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 package.)

Quick example :

Input text :

Output text :

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

  • Requirement
  • Installation
    • ServiceProviders
    • Vendor Publish
    • Configuration
  • Usage
    • Parser configuration
    • Parser configuration methods
  • Custom Parser
  • Notification
  • Contribute

Requirement

PHP

Installation

ServiceProviders

Import the MentionServiceProvider in your config/app.php:

Vendor Publish

Publish the vendor files to your application (included the config file config/mentions.php and the migration file) :

Then migrate the database :

Configuration

Usage

First, you will need to add the HasMentionTrait to the mentioner Model :

Now, you can start to parse a text in your controller or where you want :

And that's all ! At least with the default configuration. :stuck_out_tongue_closed_eyes:

Parser configuration

The MentionParser take a second parameter who is a configuration array, this is the default configuration :

The configuration is merged with the default configuration, so you can set only the options that you want to modify. Exemple :

You can also set a configuration at the runtime :

Or even get a configuration option value :

Parser configuration methods :

The parser use the Xety/Configurator package to manage the configuration. Check this repository to get all the methods and their description.

Function Name Description
setConfig(array $config) Sets a configuration array.(Will replace all configuration options be carefull)
getConfig() Get all the configuration options.
setOption(string $name, $value) Set a value for the given key.
getOption(string $name) Get a configuration value.
hasOption(string $name) Determines if current instance has the given option.
mergeConfig(array $values, bool $invert = false) Merges configuration values with the new ones. If the $invert param is set to true it will merge the default configuration into the $values.

Custom Parser

If you want more flexibility for the Parser, the best way is to create a new Parser and overwrite the methods that you want to modify. For an example, let's create a new Parser that will return a HTML link instead of a Markdown link :

To use it :

You can of course overwrite all Parser's methods if you need to.

Notification

You will need to write your own Notififation class, but I'm cool with you, you can find an example here using the delivery channel database :

Contribute

If you want to contribute, please follow this guide.


All versions of xetaravel-mentions with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
illuminate/support Version ^10.0
illuminate/database Version ^10.0
xety/configurator Version ^1.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 xetaio/xetaravel-mentions contains the following files

Loading the files please wait ....