Trouble.php 390 B

123456789101112131415161718192021
  1. <?php
  2. namespace App\Models;
  3. use App\Traits\ModelHelpers;
  4. use Illuminate\Database\Eloquent\Model;
  5. class Trouble extends Model
  6. {
  7. //
  8. use ModelHelpers;
  9. protected $table = "troubles";
  10. public function users(){
  11. return $this->belongsTo(User::class,'user_id','id');
  12. }
  13. public function areas(){
  14. return $this->belongsTo(Area::class,'area_id','id');
  15. }
  16. }