UserOwnerGroup.php 425 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App;
  3. use Illuminate\Database\Eloquent\Model;
  4. use App\Traits\ModelLogChanging;
  5. class UserOwnerGroup extends Model
  6. {
  7. use ModelLogChanging;
  8. protected $fillable = [
  9. "name" //名称
  10. ];
  11. public function usersFromAuth()
  12. {
  13. return $this->morphToMany(User::class, 'user_authable');
  14. }
  15. public function owners()
  16. {
  17. return $this->hasMany(Owner::class);
  18. }
  19. }