Website.php 746 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Model;
  4. use Hyperf\DbConnection\Model\Model;
  5. use App\Model\WebsiteCategory;
  6. use App\Model\FooterCategory;
  7. /**
  8. */
  9. class Website extends Model
  10. {
  11. /**
  12. * The table associated with the model.
  13. */
  14. protected ?string $table = 'website';
  15. /**
  16. * The attributes that are mass assignable.
  17. */
  18. protected array $fillable = [];
  19. /**
  20. * The attributes that should be cast to native types.
  21. */
  22. protected array $casts = [];
  23. public function websiteCategory()
  24. {
  25. return $this->hasMany(WebsiteCategory::class,'website_id','id');
  26. }
  27. public function footerCategory()
  28. {
  29. return $this->hasMany(FooterCategory::class,'web_id','id');
  30. }
  31. }