Initial Commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user