/
home
/
techb158
/
ileadtechnology.com
/
SSM
/
app
/
Models
/
configuration
/
misc
/
/home/techb158/ileadtechnology.com/SSM/app/Models/configuration/misc
mkdir
upload
Name
Size
Mode
Actions
BloodGroup.php
1278
0644
edit
dl
rm
Caste.php
1261
0644
edit
dl
rm
Category.php
1271
0644
edit
dl
rm
Religion.php
1270
0644
edit
dl
rm
Edit:
/home/techb158/ileadtechnology.com/SSM/app/Models/configuration/misc/BloodGroup.php
(1278B)
<?php namespace App\Models\Configuration\Misc; use Illuminate\Database\Eloquent\Model; use Spatie\Activitylog\Traits\LogsActivity; class BloodGroup extends Model { use LogsActivity; protected $fillable = [ 'name', 'description', 'options' ]; protected $casts = ['options' => 'array']; protected $primaryKey = 'id'; protected $table = 'blood_groups'; protected static $logName = 'blood_group'; protected static $logFillable = true; protected static $logOnlyDirty = true; protected static $ignoreChangedAttributes = ['updated_at']; public function student() { return $this->hasMany('App\Models\Student\Student'); } public function getOption(string $option) { return array_get($this->options, $option); } public function scopeFilterById($q, $id) { if (! $id) { return $q; } return $q->where('id', '=', $id); } public function scopeFilterByName($q, $name, $s = 0) { if (! $name) { return $q; } return $s ? $q->where('name', '=', $name) : $q->where('name', 'like', '%'.$name.'%'); } }
Save
cmd:
run