This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
vbbs/app/Models/Mode.php

28 lines
440 B
PHP
Raw Normal View History

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
class Mode extends Model
{
/**
* Return our server instance
*/
public function server()
{
switch ($this->name) {
case 'Ansi':
case 'VideoTex':
$class = 'App\\Classes\\Server\\'.$this->name;
break;
default:
throw new \Exception('Unknown server type: '.$this->name);
}
return new $class;
}
}