mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-08 22:50:56 +00:00
150 - Registering with a Valid Invitation
This commit is contained in:
@@ -6,11 +6,18 @@ 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;
|
||||
|
||||
Reference in New Issue
Block a user