Open
Conversation
Oipnet
reviewed
Oct 30, 2017
| */ | ||
| public function index() | ||
| { | ||
| if (! Auth::user()->hasRole('admin')) { |
Owner
There was a problem hiding this comment.
On ne pourrait pas externaliser ca dans un middleware ?
8e841e1 to
48a5468
Compare
TuxBoy
reviewed
Nov 4, 2017
| { | ||
| use TraitAdminController; | ||
|
|
||
| const __MODEL = 'App\\Model\\Post'; |
Collaborator
There was a problem hiding this comment.
On ne peut pas utiliser la version en PHP : Post::class ?
TuxBoy
reviewed
Nov 4, 2017
| protected function create(array $data) | ||
| { | ||
| $default = null; | ||
| $size = 40; |
Collaborator
There was a problem hiding this comment.
peut être séparer la création d'avatar dans une méthode ?
TuxBoy
reviewed
Nov 4, 2017
|
|
||
| public function before(User $user, $ability) | ||
| { | ||
| if ($user->roles->name === 'root') { |
Collaborator
There was a problem hiding this comment.
ce qui serai bien, c'est de créer une méthode abstraite qui contient tous les rôles en constante.
TuxBoy
reviewed
Nov 4, 2017
| { | ||
| use HandlesAuthorization; | ||
|
|
||
| public function before(User $user, $ability) |
Collaborator
There was a problem hiding this comment.
Il manque des commentaires et typer $ability
TuxBoy
reviewed
Nov 4, 2017
| * @param \App\Model\Role $role | ||
| * @return mixed | ||
| */ | ||
| public function view(User $user, Role $role) |
Collaborator
There was a problem hiding this comment.
Typer le retour, vu que ça toi être un boolean
TuxBoy
reviewed
Nov 4, 2017
| $table->foreign('role_id')->references('id')->on('roles') | ||
| ->onUpdate('cascade')->onDelete('cascade'); | ||
|
|
||
| $table->primary(['user_id', 'role_id']); |
TuxBoy
reviewed
Nov 4, 2017
| { | ||
| Role::insert([ | ||
| [ | ||
| 'name' => 'user', |
Collaborator
There was a problem hiding this comment.
Pourquoi ce gros tableau ? Avec les fatories c'est pas plus simple ?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mise en place d'un système d'authentification avec vérification du mail.
Mise en place d'un système de rôle et permission administrable.
Mise en place d'un front-end admin (pour l'exemple d'utilisation essentiellement)