-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathSCIMUser.php
More file actions
24 lines (18 loc) · 652 Bytes
/
SCIMUser.php
File metadata and controls
24 lines (18 loc) · 652 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
namespace App\Models;
class SCIMUser extends User
{
protected $table = 'users';
protected $throwValidationExceptions = true; // we want model-level validation to fully THROW, not just return false
public function __construct(array $attributes = [])
{
$attributes['password'] = $this->noPassword();
parent::__construct($attributes);
}
// Have to re-define this here because Eloquent will try to 'guess' a foreign key of s_c_i_m_user_id
// from SCIMUser
public function groups()
{
return $this->belongsToMany(\App\Models\Group::class, 'users_groups', 'user_id', 'group_id');
}
}