PHP code example of sebbmeyer / laravel-teams-connector
1. Go to this page and download the library: Download sebbmeyer/laravel-teams-connector library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sebbmeyer / laravel-teams-connector example snippets
Sebbmyr\LaravelTeams\TeamsConnectorServiceProvider::class,
'TeamsConnector' => Sebbmyr\LaravelTeams\Facades\TeamsConnector::class,
$app->register(Sebbmyr\LaravelTeams\TeamsConnectorServiceProvider::class);
\\ Sebbmyr\LaravelTeams\Cards\ForgeCard.php
public function getMessage()
{
return [
"@type" => "MessageCard",
"@context" => "http://schema.org/extensions",
"summary" => "Forge Card",
"themeColor" => ($this->data["status"] === 'success') ? self::STATUS_SUCCESS : self::STATUS_ERROR,
"title" => "Forge deployment message",
"sections" => [
[
"activityTitle" => "",
"activitySubtitle" => "",
"activityImage" => "",
"facts" => [
[
"name" => "Server:",
"value" => $this->data["server"]['name']
],
[
"name" => "Site",
"value" => "[". $this->data["site"]["name"] ."](http://". $this->data["site"]["name"] .")"
], [
"name" => "Commit hash:",
"value" => "[". $this->data["commit_hash"] ."](". $this->data["commit_url"] .")"
],
[
"name" => "Commit message",
"value" => $this->data["commit_message"]
]
],
"text" => ($this->data["status"] === 'success') ? $this->data["commit_author"] ." deployed some fresh code!" : "Something went wrong :/"
]
]
];
}
$card = New Sebbmyr\LaravelTeams\Cards\CustomCard('Title Test','Text Test');
$card->addColor('800080')
->addFactsText('Supported Laravel Versions',['5.x','6.x'])
->addFactsText('Unsupported Laravel Versions',['Before Version 5'])
->addAction('Laravel Website','http://www.laravel.com')
->addFacts('Facts Section',['Fact Name 1' => 'Fact Value 1','Fact Name 2' => 'Fact Value 2']);
app('TeamsConnector')->send($card);
bash
php artisan vendor:publish --provider="Sebbmyr\LaravelTeams\TeamsConnectorServiceProvider"