updates for admin area
This commit is contained in:
+24
-4
@@ -2,14 +2,19 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Cashier\Billable;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use HasApiTokens,HasRoles,Notifiable;
|
||||
use Billable, HasApiTokens, HasFactory, HasRoles, Notifiable;
|
||||
|
||||
protected $fillable = ['name', 'email', 'password', 'phone', 'avatar_path', 'marketing_opt_in'];
|
||||
|
||||
@@ -17,16 +22,31 @@ class User extends Authenticatable
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['email_verified_at' => 'datetime', 'password' => 'hashed', 'marketing_opt_in' => 'boolean'];
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
'marketing_opt_in' => 'boolean',
|
||||
'trial_ends_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function businesses()
|
||||
public function businesses(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Business::class)->withPivot(['role'])->withTimestamps();
|
||||
}
|
||||
|
||||
public function djProfile()
|
||||
public function djProfile(): HasOne
|
||||
{
|
||||
return $this->hasOne(DjProfile::class);
|
||||
}
|
||||
|
||||
public function enquiries(): HasMany
|
||||
{
|
||||
return $this->hasMany(Enquiry::class);
|
||||
}
|
||||
|
||||
public function bookings(): HasMany
|
||||
{
|
||||
return $this->hasMany(Booking::class, 'client_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user