Ticket.php 311 B

123456789101112131415161718
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class Ticket extends Model
  5. {
  6. public function user(){
  7. return $this->belongsTo(User::class);
  8. }
  9. public function ticketreplies()
  10. {
  11. return $this->hasMany(TicketReply::class)->orderBy('created_at', 'desc');
  12. }
  13. }