mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 03:04:05 +00:00
26 lines
417 B
PHP
26 lines
417 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Invitation extends Model
|
|
{
|
|
protected $guarded = [];
|
|
|
|
public static function findByCode($code)
|
|
{
|
|
return self::where('code', $code)->firstOrFail();
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function hasBeenUsed()
|
|
{
|
|
return $this->user_id !== null;
|
|
}
|
|
}
|