123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace App\Repositories\Models\TCM;
- use App\Repositories\Models\Model;
- use Prettus\Repository\Contracts\Transformable;
- use Prettus\Repository\Traits\TransformableTrait;
- /**
- * Class Patient.
- *
- * @package namespace App\Repositories\Models\TCM;
- */
- class Combinations extends Model implements Transformable
- {
- use TransformableTrait;
- protected $table = 'tcm_combinations';
- /**
- * The attributes that are mass assignable.
- *
- * @var array
- */
- protected $guarded = [];
- protected static function booted()
- {
- self::language();
- }
- public function prescription()
- {
- return $this->belongsTo(Prescription::class);
- }
- public function setNameAttribute($val)
- {
- $this->attributes['name'] = '-' . arr2str($val, '-') . '-';
- }
- public function getNameAttribute($val)
- {
- return str2arr(trim($val, '-'), '-');
- }
- }
|