AffiliateUser.php 346 B

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