Role.php 552 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Model;
  4. use App\Model\RoleUser;
  5. use Hyperf\DbConnection\Model\Model;
  6. /**
  7. */
  8. class Role extends Model
  9. {
  10. /**
  11. * The table associated with the model.
  12. */
  13. protected ?string $table = 'role';
  14. /**
  15. * The attributes that are mass assignable.
  16. */
  17. protected array $fillable = [];
  18. /**
  19. * The attributes that should be cast to native types.
  20. */
  21. protected array $casts = [];
  22. public function users()
  23. {
  24. return $this->hasMany(RoleUser::class);
  25. }
  26. }