Skip to main content

OpenLitterMap/openlittermap-web

130 stars
1 code files
View OpenLitterMap/openlittermap-web on GitHub

app/Models/User/User.php

Open in GitHub
use Illuminate\Foundation\Auth\User as Authenticatable;
 
class User extends Authenticatable
{
//
public static function boot ()
{
//
static::addGlobalScope('photosCount', function($builder) {
$builder->withCount('photos'); // photos_count
});
}
//
}