Anyone use Ardent in Laravel with the repository pattern and have it "auto-hydrate" relations on save? If so, do the rules need to be in the repository or can they be in a separate Validator service?
Does Ardent for Laravel work with Repository Pattern?
285 Views Asked by user3061986 At
1
There are 1 best solutions below
Related Questions in LARAVEL-4
- Can not access the 3rd table in laravel 5 in 3 tables have relationships
- Laravel 4.2 : add soft deleted items to whereHas condition
- why session push in laravel store my value in new array with zero index
- Routing issue with Laravel 4 and AngularJS in html5Mode
- cannot use Auth::user() in laravel 4.2
- foreign key not recognised in laravel 4.2
- Laravel 4 imagecache intervention not displaying images
- Deploy Laravel 4.2 using only FTP in a shared hosting
- jquery events on advanced datatables
- Wrong pagination link count laravel
- file get contents(#) failed to open stream HTTP request failed
- Updating a column giving error in laravel 4
- How to compare 2 'created_at' dates in Laravel 4.2 Mongodb
- Laravel 5 - Add a stylesheet only if on a certain page/controller (page specific asset)
- Laravel file validation after submitting form via jquery submit();
Related Questions in ARDENT
- Laravel Administrator package relationship error
- TDD with Laravel 4, Factory Muff, Ardent, Faker - I'm doing it wrong
- How to test, with Mockery, a controller that uses an Ardent Model?
- Is it necessary to test relationships in both directions?
- Creating a custom validation rule in Ardent w/ Laravel that can access the model to do dirty checking
- Hydration in Ardent
- Laravel/Ardent: Is there a simpler way to do custom error messages?
- Laravel Ardent not saving model when using updateUniques()
- Ardent model does not validate after save
- Make Ardent in Laravel not requiring new password on save
- Extending Ardent from jenssegers/laravel-mongodb
- Laravel Ardent not letting me save my User
- Does Ardent for Laravel work with Repository Pattern?
- Laravel/Ardent/User model editing + saving
- Can't add additional where queries in Ardent Model
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The basic idea of Ardent is autovalidation done in the model itself. However if you want to make your app as robust as possible it's better to use validation services. In the end you can use the service (or even pass it's internal $rules) wherever you wish so it's totally DRY.
EDIT:
Suppose you have such a validation service
in a repository you can do
in an Ardent model you can just modify the rules directly
Check out Ardent docs and you might find this article on validation interesting, the code above is based on that article.