tissue/app/CheckinWebhook.php

29 lines
514 B
PHP
Raw Normal View History

2020-07-19 18:39:19 +09:00
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
class CheckinWebhook extends Model
{
public $incrementing = false;
protected $keyType = 'string';
protected $fillable = ['name'];
protected static function boot()
{
parent::boot();
self::creating(function (CheckinWebhook $webhook) {
$webhook->id = Str::random(64);
});
}
public function user()
{
return $this->belongsTo(User::class);
}
}