| 1 | <?php namespace Arcanesoft\Auth\Models\Presenters; |
||
| 16 | trait HasherTrait |
||
| 17 | { |
||
| 18 | /* ----------------------------------------------------------------- |
||
| 19 | | Scopes |
||
| 20 | | ----------------------------------------------------------------- |
||
| 21 | */ |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Scope with the hashed id. |
||
| 25 | * |
||
| 26 | * @param \Illuminate\Database\Eloquent\Builder $query |
||
| 27 | * @param string $hashedId |
||
| 28 | * |
||
| 29 | * @return \Illuminate\Database\Eloquent\Builder |
||
| 30 | */ |
||
| 31 | public function scopeWithHashedId(Builder $query, $hashedId) |
||
| 35 | |||
| 36 | /* ----------------------------------------------------------------- |
||
| 37 | | Getters & Setters |
||
| 38 | | ----------------------------------------------------------------- |
||
| 39 | */ |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Get the model hash id. |
||
| 43 | * |
||
| 44 | * @return string |
||
| 45 | */ |
||
| 46 | public function getHashedIdAttribute() |
||
| 50 | |||
| 51 | /* ----------------------------------------------------------------- |
||
| 52 | | Other Methods |
||
| 53 | | ----------------------------------------------------------------- |
||
| 54 | */ |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Get the hasher. |
||
| 58 | * |
||
| 59 | * @return \Arcanedev\Hasher\Contracts\HashManager |
||
| 60 | */ |
||
| 61 | protected static function hasher() |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Decode the hashed id. |
||
| 68 | * |
||
| 69 | * @param string $hashedId |
||
| 70 | * |
||
| 71 | * @return int |
||
| 72 | */ |
||
| 73 | protected static function decodeHashedId($hashedId) |
||
| 77 | } |
||
| 78 |