You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

40 lines
914 B

<?php
namespace App\Documents;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Notifications\Notifiable;
use Jenssegers\Mongodb\Auth\User as Authenticatable;
class UserDocument extends Authenticatable
{
use HasFactory, Notifiable, BaseDocument;
public $incrementing = true;
protected $connection = 'mongodb';
protected $fillable = ['group_id', 'name', 'email', 'password'];
protected $hidden = ['password', 'remember_token'];
/**
* The attributes that should be cast.
*
* @var array<string, string>
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
public function can($abilities = [], $arguments = []): bool
{
foreach ($abilities as $permission) {
if (in_array($permission, $this->permissions)) {
return true;
}
}
return false;
}
}