vuk4asin / EscapeRoomLaravel

0 stars 0 forks source link

Sugestije #1

Open jstojiljkovic opened 3 years ago

jstojiljkovic commented 3 years ago

https://github.com/vuk4asin/EscapeRoomLaravel/blob/2ae9a46d9b2ca4cb82228cf95d03daeb2902a9f0/Reservation/app/Http/Controllers/ReservationController.php#L25

Ako budes zeleo da nastavis sa ucenjem Laravela, evo par sugestija Dobro bi bilo da za requeste koristis: https://laravel.com/docs/8.x/validation#form-request-validation Ovim si pokrio validaciju i zapravo ne postoji tacin da ti neko posalje pogresne/maliciozne podatke

Controller bi u sustini samo trebao da primi input i da output, tj da nema pojma sta se desava sa bazom ili modelima, tako da bih preporucio da koristis Service/Repository pattern, a u zavisnosti od slozene arhitekture koristis oba.

Primer Service/Repository pattern-a: https://github.com/jstojiljkovic/flight-advisor-api

vuk4asin commented 3 years ago

Zdravo Jovane,

Hvala ti na sugestijama! 😀 Sto se tice odvajanja tog data layer-a logike koji bi radio sa bazom i posle se negde iznad instancirao, upoznat sam sa tim ali nisam imao prilike da to koristim. Ostalo cu svakako da pogledam i da proradim. 🙂

On Wed, 31 Mar 2021 at 16:50 Jovan Stojiljkovic @.***> wrote:

https://github.com/vuk4asin/EscapeRoomLaravel/blob/2ae9a46d9b2ca4cb82228cf95d03daeb2902a9f0/Reservation/app/Http/Controllers/ReservationController.php#L25

Ako budes zeleo da nastavis sa ucenjem Laravela, evo par sugestija Dobro bi bilo da za requeste koristis: https://laravel.com/docs/8.x/validation#form-request-validation Ovim si pokrio validaciju i zapravo ne postoji tacin da ti neko posalje pogresne/maliciozne podatke

Controller bi u sustini samo trebao da primi input i da output, tj da nema pojma sta se desava sa bazom ili modelima, tako da bih preporucio da koristis Service/Repository pattern, a u zavisnosti od slozene arhitekture koristis oba.

Primer Service/Repository pattern-a: https://github.com/jstojiljkovic/flight-advisor-api

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vuk4asin/EscapeRoomLaravel/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMKS53MJYPBN3GGL56AUDJDTGMZD3ANCNFSM42E2WEBA .

vuk4asin commented 3 years ago

Iskreno vise sam se na frontend fokusirao, jer sam imao problemcice svakojake 😀

Backend je napravljen tu gde je i ceka da bude pozvan 😀

On Wed, 31 Mar 2021 at 20:19 Vukasin Tonic @.***> wrote:

Zdravo Jovane,

Hvala ti na sugestijama! 😀 Sto se tice odvajanja tog data layer-a logike koji bi radio sa bazom i posle se negde iznad instancirao, upoznat sam sa tim ali nisam imao prilike da to koristim. Ostalo cu svakako da pogledam i da proradim. 🙂

On Wed, 31 Mar 2021 at 16:50 Jovan Stojiljkovic @.***> wrote:

https://github.com/vuk4asin/EscapeRoomLaravel/blob/2ae9a46d9b2ca4cb82228cf95d03daeb2902a9f0/Reservation/app/Http/Controllers/ReservationController.php#L25

Ako budes zeleo da nastavis sa ucenjem Laravela, evo par sugestija Dobro bi bilo da za requeste koristis: https://laravel.com/docs/8.x/validation#form-request-validation Ovim si pokrio validaciju i zapravo ne postoji tacin da ti neko posalje pogresne/maliciozne podatke

Controller bi u sustini samo trebao da primi input i da output, tj da nema pojma sta se desava sa bazom ili modelima, tako da bih preporucio da koristis Service/Repository pattern, a u zavisnosti od slozene arhitekture koristis oba.

Primer Service/Repository pattern-a: https://github.com/jstojiljkovic/flight-advisor-api

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vuk4asin/EscapeRoomLaravel/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMKS53MJYPBN3GGL56AUDJDTGMZD3ANCNFSM42E2WEBA .