1
0
This repository has been archived on 2021-02-16. You can view files and clone it, but cannot push or open issues or pull requests.
Files
ttv-streamkit/app/TwitchWebhook.php

47 lines
885 B
PHP

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class TwitchWebhook extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
"type",
"topic",
"callback",
"active",
"expires_at",
"disabled"
];
/**
* Get the user that owns the access token.
*/
public function user() {
return $this->belongsTo("App\User");
}
/**
* Get webhook action
*/
public function webhookActions() {
return $this->hasMany("App\WebhookAction", "webhook_id");
}
// event handlers
/**
* Get discord message/embed assigned to this twitch webhook
*/
public function discordWebhookMessage() {
return $this->morphedByMany("App\DiscordWebhookMessage", "twitch_webhook_event");
}
}