%PDF- %PDF-
Direktori : /home/forge/api-takeaseat.eco-n-tech.co.uk/app/Models/ |
Current File : //home/forge/api-takeaseat.eco-n-tech.co.uk/app/Models/Specialism.php |
<?php namespace App\Models; use Spatie\Sluggable\HasSlug; use Spatie\Sluggable\SlugOptions; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Specialism extends Model { use HasFactory, HasSlug; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = [ 'name', 'slug', 'description' ]; /** * Get the options for generating the slug. */ public function getSlugOptions() : SlugOptions { return SlugOptions::create() ->generateSlugsFrom('name') ->saveSlugsTo('slug'); } /** * Get the therapists for this specialism */ public function therapists() { return $this->belongsToMany(Therapist::class, 'specialism_therapist', 'specialism_id', 'therapist_id'); } }