1 | <?php |
||
41 | class Employee extends Model implements AuthenticatableContract, |
||
42 | AuthorizableContract, |
||
43 | CanResetPasswordContract, |
||
44 | PolicyCheckable |
||
45 | { |
||
46 | use Authenticatable, Authorizable, CanResetPassword; |
||
47 | |||
48 | /** |
||
49 | * The database table used by the model. |
||
50 | * |
||
51 | * @var string |
||
52 | */ |
||
53 | //protected $table = 'employees'; |
||
54 | |||
55 | /** |
||
56 | * The attributes that are mass assignable. |
||
57 | * |
||
58 | * @var array |
||
59 | */ |
||
60 | protected $fillable = ['name', 'email', 'password']; |
||
61 | |||
62 | /** |
||
63 | * The attributes excluded from the model's JSON form. |
||
64 | * |
||
65 | * @var array |
||
66 | */ |
||
67 | protected $hidden = ['password', 'remember_token']; |
||
68 | |||
69 | /** |
||
70 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
71 | */ |
||
72 | 2 | public function company() |
|
76 | |||
77 | /** |
||
78 | * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany |
||
79 | */ |
||
80 | 4 | public function groups() |
|
84 | |||
85 | /** |
||
86 | * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany |
||
87 | */ |
||
88 | public function meetings() |
||
92 | |||
93 | /** |
||
94 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
95 | */ |
||
96 | public function calendars() |
||
100 | |||
101 | /** |
||
102 | * Get the e-mail address where password reset links are sent. |
||
103 | * This is needed for multiple user type login |
||
104 | * |
||
105 | * Make email unique |
||
106 | * |
||
107 | * @return string |
||
108 | */ |
||
109 | 2 | public function getEmailForPasswordReset() |
|
120 | |||
121 | /** |
||
122 | * @param Group $group |
||
123 | * @return bool |
||
124 | */ |
||
125 | 4 | public function belongsToGroup(Group $group) |
|
132 | |||
133 | /* |
||
134 | * for a normal employee the policyCheckable methods say if the employee can se or not the element |
||
135 | */ |
||
136 | |||
137 | /** |
||
138 | * @param Group $group |
||
139 | * @return bool |
||
140 | */ |
||
141 | public function verifyGroup(Group $group) |
||
145 | |||
146 | /** |
||
147 | * @param Employee $employee |
||
148 | * @return bool |
||
149 | */ |
||
150 | public function verifyEmployee(Employee $employee) |
||
154 | |||
155 | /** |
||
156 | * @param Company $company |
||
157 | * @return bool |
||
158 | */ |
||
159 | public function verifyCompany(Company $company) |
||
163 | } |
||
164 |