ahmedhamid13 / Blogy_Laravel

Blogy project is based on laravel frame work..It has login and Registration forms for user with all restrictions on it, and the user can create a post, editing it and deleted it with some validations on all this process.
0 stars 0 forks source link

validation should be in one place #1

Open mhmodmonim opened 4 years ago

mhmodmonim commented 4 years ago

here you are using the validation two times, first in PostRequest class and second in the controller why don't you just write all your validation rules in one place, as a best practice, in your PostRequest.

another note, use a separate request validation in store and update methods, to ensure the validation rules for each case

https://github.com/Ahmed-Abd-elhamid/Bloggy/blob/3823a89df6da622d8511a940da08b26ac2cb9b9a/app/Http/Controllers/PostController.php#L50-L53

ahmedhamid13 commented 4 years ago

I will handling it.. thank for informing me, I really appreciate that.. too much thanks. .. Grateful for your support :)