33 lines
833 B
PHP
33 lines
833 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Foundation\Auth\User as Authenticatable;
|
|
use Illuminate\Notifications\Notifiable;
|
|
use Laravel\Sanctum\HasApiTokens;
|
|
use Spatie\Permission\Traits\HasRoles;
|
|
|
|
class User extends Authenticatable
|
|
{
|
|
use HasApiTokens,HasRoles,Notifiable;
|
|
|
|
protected $fillable = ['name', 'email', 'password', 'phone', 'avatar_path', 'marketing_opt_in'];
|
|
|
|
protected $hidden = ['password', 'remember_token'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['email_verified_at' => 'datetime', 'password' => 'hashed', 'marketing_opt_in' => 'boolean'];
|
|
}
|
|
|
|
public function businesses()
|
|
{
|
|
return $this->belongsToMany(Business::class)->withPivot(['role'])->withTimestamps();
|
|
}
|
|
|
|
public function djProfile()
|
|
{
|
|
return $this->hasOne(DjProfile::class);
|
|
}
|
|
}
|