diff --git a/app/Models/Team.php b/app/Models/Team.php index dc29d6e..7fb7db1 100644 --- a/app/Models/Team.php +++ b/app/Models/Team.php @@ -2,19 +2,18 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Concerns\HasUuids; use Illuminate\Database\Eloquent\Factories\HasFactory; use Laravel\Jetstream\Events\TeamCreated; use Laravel\Jetstream\Events\TeamDeleted; use Laravel\Jetstream\Events\TeamUpdated; +use App\Traits\Uuid; use Laravel\Jetstream\Team as JetstreamTeam; -#use App\Traits\Uuid; -use Illuminate\Database\Eloquent\Concerns\HasUuids; # uuids contain dashes class Team extends JetstreamTeam { use HasFactory; - #use Uuid; - use HasUuids; + use Uuid; /** * The attributes that should be cast. diff --git a/app/Models/User.php b/app/Models/User.php index d573f97..4584fb5 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -2,16 +2,15 @@ namespace App\Models; -use Illuminate\Contracts\Auth\MustVerifyEmail; +use Illuminate\Database\Eloquent\Concerns\HasUuids; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Laravel\Fortify\TwoFactorAuthenticatable; use Laravel\Jetstream\HasProfilePhoto; use Laravel\Jetstream\HasTeams; +use App\Traits\Uuid; use Laravel\Sanctum\HasApiTokens; -#use App\Traits\Uuid; -use Illuminate\Database\Eloquent\Concerns\HasUuids; # uuids contain dashes class User extends Authenticatable { @@ -19,11 +18,11 @@ class User extends Authenticatable use HasFactory; use HasProfilePhoto; use HasTeams; + use Uuid; use Notifiable; + use TwoFactorAuthenticatable; - #use Uuid; - use HasUuids; - + /** * The attributes that are mass assignable. * @@ -36,7 +35,7 @@ class User extends Authenticatable 'google_id', 'google_token', 'google_refresh_token', - ]; + ]; /** * The attributes that should be hidden for serialization. diff --git a/app/Traits/Uuid.php b/app/Traits/Uuid.php new file mode 100644 index 0000000..fe779a9 --- /dev/null +++ b/app/Traits/Uuid.php @@ -0,0 +1,26 @@ +id = str_replace('-', '', (string) Str::uuid()); + }); + } + + public function getIncrementing(): bool + { + return false; + } + + public function getKeyType(): string + { + return 'string'; + } +}