Group.php 373 B

123456789101112131415161718192021
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Group extends Model
  5. {
  6. public $timestamps = false;
  7. protected $table = "group";
  8. public function one_rlation()
  9. {
  10. return $this->hasOne('App\User','id','user_id');
  11. }
  12. public function many_users()
  13. {
  14. return $this->hasMany('App\User','id','user_id');
  15. }
  16. }