-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from Guilherme-Silva0/alterando-apresentacao-da…
…s-permissoes-do-usuario Corrigindo bug de retorno das permissões do usuário
- Loading branch information
Showing
2 changed files
with
29 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file is part of Hyperf. | ||
* | ||
* @link https://www.hyperf.io | ||
* @document https://hyperf.wiki | ||
* @contact [email protected] | ||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE | ||
*/ | ||
|
||
namespace App\Model; | ||
|
||
use Carbon\Carbon; | ||
use Hyperf\DbConnection\Model\Model; | ||
|
||
/** | ||
* @property int $id | ||
* @property string $uuid | ||
* @property string $name | ||
* @property string $email | ||
* @property string $birth_date | ||
* @property string $document | ||
* @property string $cellphone | ||
* @property string $password | ||
* @property string $remember_token | ||
* @property \Carbon\Carbon $created_at | ||
* @property \Carbon\Carbon $updated_at | ||
* @property int $id | ||
* @property string $uuid | ||
* @property string $name | ||
* @property string $email | ||
* @property string $birth_date | ||
* @property string $document | ||
* @property string $cellphone | ||
* @property string $password | ||
* @property string $remember_token | ||
* @property Carbon $created_at | ||
* @property Carbon $updated_at | ||
*/ | ||
class User extends Model | ||
{ | ||
|
@@ -34,10 +43,16 @@ class User extends Model | |
protected array $guarded = []; | ||
|
||
protected array $hidden = ['password', 'email', 'id', 'remember_token']; | ||
|
||
/** | ||
* The attributes that should be cast to native types. | ||
*/ | ||
protected array $casts = ['id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime']; | ||
|
||
/* protected ?string $connection = 'default'; */ | ||
|
||
public function getPermissionsAttribute($value) | ||
{ | ||
return unserialize($value); | ||
} | ||
} |