app/Models/User/User.php
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 }); } //}