]> BookStack Code Mirror - bookstack/blobdiff - app/Actions/Webhook.php
Added 'Sort Book' action to chapters
[bookstack] / app / Actions / Webhook.php
index ed13856f3877e2db14daa9d961140c55ba2e969d..72a67ad9201f14ab38a359f0efe98d950fb19add 100644 (file)
@@ -3,24 +3,34 @@
 namespace BookStack\Actions;
 
 use BookStack\Interfaces\Loggable;
+use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Collection;
 use Illuminate\Database\Eloquent\Factories\HasFactory;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\Relations\HasMany;
 
 /**
- * @property int $id
- * @property string $name
- * @property string $endpoint
+ * @property int        $id
+ * @property string     $name
+ * @property string     $endpoint
  * @property Collection $trackedEvents
- * @property bool $active
+ * @property bool       $active
+ * @property int        $timeout
+ * @property string     $last_error
+ * @property Carbon     $last_called_at
+ * @property Carbon     $last_errored_at
  */
 class Webhook extends Model implements Loggable
 {
-    protected $fillable = ['name', 'endpoint'];
+    protected $fillable = ['name', 'endpoint', 'timeout'];
 
     use HasFactory;
 
+    protected $casts = [
+        'last_called_at'  => 'datetime',
+        'last_errored_at' => 'datetime',
+    ];
+
     /**
      * Define the tracked event relation a webhook.
      */