namespace App\Models;
+use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
return $this->username;
}
+ public function getRandomQuoteAttribute() {
+ return $this->results()
+ ->where('comment', '!=', '')
+ ->whereHas('round', function(Builder $query) {
+ $query->where('locked', true);
+ })
+ ->inRandomOrder()
+ ->first();
+ }
+
public function isAdmin() {
return $this->role === 'admin';