<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Foundation\Auth\User as Authenticatable;

class Teacher extends Authenticatable {
	protected $table = 'teacher';
	protected $fillable = [ 
			'mobile',
			'password',
			'realname',
			'sex',
			'age',
			'photo',
			'underwrite',
			'join_at'
	];
	public static $sexMap = [ 
			0 => '女',
			1 => '男'
	];
	public function class() {
		return $this->belongsToMany ( 'App\Models\Classes', 'teacher_class', 'teacher_id', 'class_id' );
	}
}
