Questions tagged [ardent]

Ardent is a package that provides self-validating smart models for the Laravel framework's Eloquent O/RM.

Ardent provides self-validating smart models for Laravel Framework 4's Eloquent O/RM, based on the Aware bundle for Laravel 3. With it, Laravel validation rules can be inserted into the model's class as a tag variable. At save, the model will validate itself and modify the database or in faliure it gives error messages.

Installation

Add laravelbook/ardent as a requirement to composer.json:

{
    "require": {
        "laravelbook/ardent": "dev-master"
    }
}

Update the packages with composer update or install with composer install.

Useful links

57 questions
0
votes
1 answer

Laravel 4 - Ardent - Unable to use $relationsData

I have had my Models relationships defined the traditional way and it has been working fine. However, I started using Ardent to make validation easier, and noticed that it has a useful feature for defining Eloquent…
Terrawheat
  • 21
  • 1
  • 3
0
votes
1 answer

Can't add additional where queries in Ardent Model

I'm having a problem using LaravelBook/Ardent. My logic is exclude the soft deleted rows in unique validation using the code: public static $rules = array( 'name' => 'required|unique:paper_colors,name,deleted_at,NULL', 'description' =>…
lukaserat
  • 4,768
  • 1
  • 25
  • 36
0
votes
1 answer

Does Ardent for Laravel work with Repository Pattern?

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?
user3061986
  • 75
  • 1
  • 9
0
votes
1 answer

Hydration in Ardent

Could you clarify what is the difference between autoHydrateEntityFromInput and forceEntityHydrationFromInput ? I cannot get it. If I set first property to true then I'll always get input data hydrated to model, but then what's the second…
Victor
  • 5,073
  • 15
  • 68
  • 120
0
votes
1 answer

How to test, with Mockery, a controller that uses an Ardent Model?

I am trying to test this function in a Laravel controller: /** * Store a newly created resource in storage. * * @return Response */ public function store() { $project = $this->project->create(Input::all()); …
Cmorales
  • 958
  • 1
  • 9
  • 24
0
votes
1 answer

Can I use ardent in laravel to validate fields that I don't want it to save?

I want Ardent to check that password and password confirmation match...yet, I obviously don't want to store password confirmation in the database. So how do I get Ardent to do it's stuff and validate but not try to save the password confirmation? …
Claire
  • 3,683
  • 13
  • 47
  • 74
0
votes
1 answer

Validation on login form

Here is my postLogin method: $userdata = array( 'email' => Input::get('email'), 'password' => Input::get('password'), 'enabled' => 1 ); if (Auth::attempt($userdata)) { return…
Grug
  • 1,870
  • 5
  • 25
  • 38
0
votes
1 answer

Laravel live server won't work with eager loading

I've got some code that has been working fine on my local machine (WAMP, PHP 5.4.3) but not on a production server (CentOS, PHP 5.4.11) and I can't see why, the offending line of code is: $sharedList = SharedList::with('itemList') …
Al_
  • 2,479
  • 7
  • 29
  • 43
0
votes
1 answer

Ardent validation and mutators

Here's how my model works. I have a Post model that has a expires_at column. Users provide an integer for the number of days they would like the Post to last. This was pretty straightforward when I was doing validation in the controller. Just…
Brian Ortiz
  • 1,821
  • 1
  • 20
  • 47
0
votes
2 answers

Laravel 4 Ardent beforeSave() and $this->changed()

I'm running though the Laravel 4 Ardent package found here: https://github.com/laravelbook/ardent I'm trying to integrate the code found in Ardent's README within my User Model: public function beforeSave( $forced ) { // if there's a new…
Pathsofdesign
  • 4,678
  • 5
  • 18
  • 26
0
votes
1 answer

When using Laravel and Ardent, and when trying to use good testing practice, how would I make this work?

I'm using Laravel 4 and I followed JeffreyWay's testing book. Right now I'm working on testing my controllers. My specific question is in regards to line 69 of this: http://paste.laravel.com/v2B Since I obviously can't do this, what do I need to do?…
-1
votes
1 answer

Validating unique constraints in Laravel using the Ardent validation package

I am using Ardent in my Laravel application to provide record validation. Ardent uses a static $rules variable in your model to store your validation information, like so: class Project extends Ardent{ public static $rules = array ( …
carbontwelve
  • 1,090
  • 1
  • 13
  • 24
1 2 3
4