init project
This commit is contained in:
30
app/Models/SampleSource.php
Normal file
30
app/Models/SampleSource.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class SampleSource extends BaseModel
|
||||
{
|
||||
public $timestamps = false;
|
||||
use HasFactory;
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $fillable = ['name_en', 'name_kh', 'lab_id','is_default'];
|
||||
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
public function lab(){
|
||||
return $this->belongsTo('App\Models\Laboratory', 'lab_id','id');
|
||||
}
|
||||
|
||||
public function telegramChatId(){
|
||||
return $this->belongsTo(SampleSourceTelegram::class,'id', 'sample_source_id');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user