/
home
/
maktab
/
server
/
app
/
Models
/
File Upload :
llllll
Current File: /home/maktab/server/app/Models/Users_to_maktab.php
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Users_to_maktab extends Model { use HasFactory,Selector,SoftDeletes; protected $appends = ['type_str']; protected $fillable = [ 'user_id', 'user_type', 'active', 'maktab_id', 'type_employee', 'type', ]; protected $casts=[ 'active'=>'boolean' ]; static $TYPE =[ //مدیر پنل ادمین 1 => 'مدیران', //پدر 2 => 'مدیر خانواده', //مدیر 3 => 'مدیر مکتب', //عوامل 4 => 'عوامل', //سوپروایزر 5 => 'سوپروایزر', 6 => 'مهمان', ]; public function getTypeStrAttribute() { return self::$TYPE[$this->attributes['type']]??'Not defined'; } public function userTypeCnt() { return $this->belongsTo(Cnt::class,'user_type'); } public function file() { return $this->belongsTo(File::class); } //for employee public function maktab() { return $this->belongsTo(Maktab::class); } public function cloony() { return $this->hasOne(Cloony::class,'master_id'); } public function type_cnt() { return $this->belongsTo(Cnt::class,'type_employee'); } }
Copyright ©2k19 -
Hexid
|
Tex7ure