DiscordUser.php 642 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  6. use Spatie\Activitylog\Traits\LogsActivity;
  7. class DiscordUser extends Model
  8. {
  9. use HasFactory;
  10. protected $guarded = [];
  11. public $incrementing = false;
  12. /**
  13. * @return BelongsTo
  14. */
  15. public function user(){
  16. return $this->belongsTo(User::class);
  17. }
  18. /**
  19. * @return string
  20. */
  21. public function getAvatar(){
  22. return "https://cdn.discordapp.com/avatars/" . $this->id . "/" . $this->avatar . ".png";
  23. }
  24. }