/
proc
/
self
/
root
/
home
/
maktab
/
server
/
app
/
Models
/
File Upload :
llllll
Current File: //proc/self/root/home/maktab/server/app/Models/File.php
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class File extends Model { use HasFactory; protected $fillable = [ 'original_name', 'title', 'ext', 'src', 'size', 'thumb', 'gallery_id', 'notice_id', 'experience_id', 'type' ]; protected $appends = ['full_src','full_thumb']; protected function getFullSrcAttribute() { return url($this->src); } protected function getFullThumbAttribute() { if (is_null($this->thumb)){ return null; }else{ return url($this->thumb); } } public function teacher() { $cnt = Cnt::where('value','مربی')->first(); return $this->hasMany(User::class)->where('type_employee',$cnt->id); } public function student() { return $this->hasMany(Student::class); } }
Copyright ©2k19 -
Hexid
|
Tex7ure