| 1 | <?php |
||
| 10 | trait RequestTrait |
||
| 11 | { |
||
| 12 | |||
| 13 | /** |
||
| 14 | * This function will be called from the Requests (authorize) to check if a user |
||
| 15 | * has permission to perform an action. |
||
| 16 | * User can set multiple permissions (separated with "|") and if the user has |
||
| 17 | * any of the permissions, he will be authorize to proceed with this action. |
||
| 18 | * |
||
| 19 | * @return bool |
||
| 20 | */ |
||
| 21 | public function validatePermission() |
||
| 45 | |||
| 46 | } |
||
| 47 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: