Continuing the discussion from Resurse : Laravel:
Imi place ce face Ardent pentru oferta multe solutii un pic mai digerabile decat la alte variante de de ORM. Ce nu imi place la acest articole este
- folosind Ardent este ca acel model devine un pic cam “gras”, cuprizand atat partea de repository cat si partea de validare.
- se considera ca request-ul duce direct in salvarea de model si de acolo vin erorile inapoi la form. Consider ca de multe ori nu stau asa lucrurile. Un request (de formular sau de actiune ajax) ar trebui sa duca intr-o validare de action ce returneaza erori. Altfel ajungi la paradoxuri in care pentru formularul de creaare cont, pui logica de verificare parola in businessul de model
- In articol (UPDATE) nu aminteste ca in urmatoarea versiune (4.3 adica noul 5.0) va aparea FormRequest ce il poti injecta direct intr-o metoda de Controller si poti face automat acel redirect (eliminant mult cod duplicat ce il faceai in fiecare metoda de controller ce avea grija de formular). Laravel 5.0 - Form Requests | MattStauffer.com
ps: prin faptul ca laravel a introdus validare pe request imi arata ca ma potrivesc cu ei la gusturi.
Artisan iti aminteste de toate chestiile noi:
./artisan changes
Changes For Laravel 5.0.*
-> Allow passing a priority to Eloquent event listeners.
-> Tweak ‘compile’ configuration file for ‘files’ and ‘providers’ support.
-> Allow method injection via IoC to any controller or route method.
-> Added the ‘call’ method to the Container to execute a callback with its dependencies.
-> Added ‘route:cache’ Artisan command for ultra fast route definition.
-> Added new FormRequest class for simpler validation and authorization.
-> Contracts for most major components of the framework.
-> Flysystem integration now included with framework.
-> Passing an Eloquent model to a URL generator method will now automatically pull its ID.
-> Make both {{ }} and {{{ }}} escape values by default, new {!! !!} construct to echo raw data.
-> Add ‘after’ callback to Validator.
-> Returning ‘false’ from a database ::chunk operation will stop processing records.
-> The ‘swift.transport’ container binding is now an instance of ‘Illuminate\Mail\TransportManager’.
-> Added support for container context aware bindings and container tags.
-> SVG files are now considered valid by the ‘image’ validation rule.
-> Eloquent models are now gracefully retrieved when needed by queue jobs.
Nu ma prind insa ce cautam in topicul asta. Lucrurile bad de care ai spus sunt despre Ardent, nu laravel.
True. Am fost un pic ambiguu. Am vrut sa spun ce nu imi place la laravel/ardent vis a vis de ideil exprimate in articol