src/Models/Repositories/MentionRepository.php
public static function create(Model $model, Model $recipient, $notify = true): Mention
    {
        $mention = Mention::firstOrCreate([
            'model_type' => get_class($model),
            'model_id' => $model->getKey(),
            'recipient_type' => get_class($recipient),
            'recipient_id' => $recipient->getKey()
        ]);

        if ($notify) {
            $mention->notify($model, $recipient);
        }

        return $mention;
    }
public static function create(Model $model, Model $recipient, $notify = true): Mention
    {
        $mention = Mention::firstOrCreate([
            'model_type' => get_class($model),
            'model_id' => $model->getKey(),
            'recipient_type' => get_class($recipient),
            'recipient_id' => $recipient->getKey()
        ]);

        if ($notify) {
            $mention->notify($model, $recipient);
        }

        return $mention;
    }
public static function create ( Model $ model , Model $ recipient , $ notify = true ) : Mention { $ mention = Mention :: firstOrCreate ( [ 'model_type' => get_class ( $ model ) , 'model_id' => $ model -> getKey ( ) , 'recipient_type' => get_class ( $ recipient ) , 'recipient_id' => $ recipient -> getKey ( ) ] ) ; if ( $ notify ) { $ mention -> notify ( $ model , $ recipient ) ; } return $ mention ; }
Creates a new mention.

@return \Xetaio\Mentions\Models\Mention
Creates a new mention .